Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github pages show "CNAME is already taken" although it is not

I want to host the repository https://github.com/username/username.github.io on github pages and use the custom subdomain user.institution.ac.in. I added a CNAME record for username.github.io in my domain's DNS settings, but when I tried to add a CNAME record for the subdomain in the respository, it shows: "The CNAME user.institution.ac.in is already taken". There are no other repositories using this CNAME currently, so I can't figure out the problem. Please help.

like image 889
thesagniksaha Avatar asked Mar 16 '20 13:03

thesagniksaha


Video Answer


2 Answers

It is a workaround that should not be necessary, but what worked for me was to git rm CNAME, commit, and push, and then specify the x.github.io domain on the Github repo configuration page (not via the CNAME file directly).

I contacted Github support and was walked through this and several other things, including some kind of reset done on their end. This may or not be necessary in your case.

I needed to reselect "Enforce HTTPS" after this so that http connections would be forced to https.

like image 147
Keith Bennett Avatar answered Oct 08 '22 07:10

Keith Bennett


This error usually happens when your custom domain has been attached to someone else’s Pages site in error, or the previous owner of this domain used it to host a Pages site before it was bought by you. You’ll need to reach out to the GitHub Support team for direct private help.

From https://github.community/t/the-cname-is-already-taken/149785

My scenario was that the rebuilt process deleted the CNAME file created by Github, so please locate the CNAME file in your project

like image 21
Feuda Avatar answered Oct 08 '22 08:10

Feuda