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

I want to host the repository https://github.com/cmitiisertvm/cmitiisertvm.github.io on github pages and use the custom subdomain cmit.iisertvm.ac.in. I added a CNAME record for cmitiisertvm.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 cmit.iisertvm.ac.in is already taken. There are no other repositories using this CNAME currently, so I can’t figure out the problem. Please help.

5 Likes

Hey @thesagniksaha, it looks like this got resolved, is there any suggestions you can write up for folks with the same issue you had? Thanks! 

1 Like

The problem that happened here was a case of subdomain takeover, and is a serious issue. If you create a subdomain CNAME record in your domain’s DNS settings that points to a github username and don’t update the custom domain address in your repository’s  Settings > GitHub Pages within a stipulated amount of time, your subdomain could be taken over by someone else, and if you try to add that subdomain to a repository later, it will show that “The CNAME subdomain.domain.com is already taken”.

Patrik has written a lot about subdomain takeovers in his blog here: https://0xpatrik.com/

Hope this was useful.

Were you able to resolve the takeover? How did you determine that it had been taken over in the first place?