Github pages show "CNAME is already taken" although it is not
Asked Answered
C

2

6

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.

Carabiniere answered 16/3, 2020 at 13:45 Comment(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.Liv
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.Liv
L
3

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.

Liv answered 26/4, 2020 at 18:58 Comment(2)
So weird, but this does seem to work. Deleted my CNAME and then set Settings -> Custom domain (which just creates the CNAME again), and no more "Page build warning" emails. I guess in the future when making a gh-pages site, have to remember not to even bother making a CNAME file and just do it from the web interface.Carbylamine
This did not work for me. I deleted the CNAME, but the web interface for setting it still didn't work.Eunaeunice
A
1

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

Aimee answered 7/1, 2021 at 11:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.