6
votes

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.

2
I have this exact same problem. If you have resolved it, could you share the solution? I have sent a support request to Github but don't know if/when I will get a response. I don't think it's a DNS issue because I have verified with dig blog.example.com that the DNS is correctly pointing the me.github.io address, and I get a Github 404 page when I go to my subdomain in a browser.Keith Bennett
One thing you can try is to go to the Github web site and enter your subdomain in the search text input field, surrounded by double quotes, and then select "Code" to the right of it, to find all occurrences of it on Github. I tried that with mine but there were no other occurrences.Keith Bennett

2 Answers

2
votes

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.

1
votes

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