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 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.
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
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