-
Select Topic AreaQuestion BodyHi all, I seem to have an issue with setting up a custom domain. I previously had a Github Pages blog setup in stark0de.github.io and the domain stark0de.com pointing to it correctly. Because I wanted to make some changes I deleted the repo and re-created it with new content (it is using Hugo to deploy the site with Github Actions). I tried to configure the custom domain from Settings>Pages but I got the following error message: The custom domain |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
This happens because GitHub “locks” a custom domain to stop takeovers. Do this:
After verification + correct DNS, the “already taken” error goes away and the domain attaches to the new repo. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
|
Hi there! This is a common issue when you delete a GitHub Pages repository that had a custom domain configured. The domain remains "claimed" by the old (now deleted) repository, preventing you from using it with your new repo. Solution: Verify Your Domain OwnershipYou need to verify domain ownership to release it from the old repo. Here's how: Step 1: Add DNS TXT Record for Verification
The TXT record will look something like:
Step 2: Configure Custom Domain in New RepoOnce verified:
Alternative Quick Fix (If Verification Doesn't Work)If domain verification is taking too long or not working:
Your DNS Configuration Should Be:Or for apex domain: Additional TipIn your Hugo repository, make sure you have a CNAME file in your This ensures the custom domain setting persists after deployments. The domain verification method is the most reliable solution. Let me know if you encounter any issues! |
Beta Was this translation helpful? Give feedback.
This happens because GitHub “locks” a custom domain to stop takeovers.
Do this:
CNAMEfile in the old Pages branch (if it exists)._github-pages-challenge-<your-user-or-org>=<value GitHub gives you>www.stark0de.com: set a CNAME tostark0de.github.iost…