For our podcast we have a simple website in place with Jekyll hosted on GitHub Pages. While setting it up, I noticed the option to verify your your domain with the GitHub repo. This way you get some perks, but will also indicate to people that they are looking at the right place. Our domain, lives over at Namecheap. While GitHub does give you some instructions on how to setup the verification, Namecheap seems to want to have it a bit more specific. Just so I won't forget myself, I decided to put it in this post.
How GitHub Domain Verification Works
To verify that the domain is actually yours, you need to add a TXT type DNS record to it. This is basically just a dummy record that has no other purpose than to serve text, probably for these kinds of scenarios.
When you go to the settings of your organization account (github.com/YOUR_ORGANIZATION > Settings) on the left you will find the Verified Domains option. Click that and click New Domain.
In our case YOUR_ORGANIZATION will be nullpointersio, which is simply the unique name we came up with.
You will now see a page like in the screenshot below. Note that I am using a spare domain I have laying around: blazingunicorn.nl.
As mentioned, GitHub gives you some instructions on how to do it, but that's not the way it works with Namecheap unfortunately.
What is Special About Namecheap?
I don't know! What I do know is that the TXT record that GitHub suggests needs to be a bit different. If we look at the screenshot above again, it suggests us to add a TXT record named
_github-challenge-nullpointersio.blazingunicorn.nl. the value for this should be the code that is listed just beneath that, 9613658984 in this case.
If we look at that more closely at the TXT record name, you can see a static piece
_github-challenge and from there our organization name
nullpointersio and domain we want to verify
Now the weird part is that for Namecheap, and maybe others, I don't know, the TXT record name should just be
_github-challenge-YOURORGANIZATION and not include the domain. So in our case, it should just be
_github-challenge-nullpointersio. This is probably because the way DNS works, or at least DNS works at Namecheap. They probably add the domain part to a record themselves.
Go into your Namecheap account, go to Domain list, then find your domain and click Manage. From there navigate to the Advanced DNS tab and click the Add New Record button. Then fill out the required fields with the data from above. You can see the resulting record in the screenshot below.
Now we Wait...
That should do the trick! The thing about DNS is, is that it can take a little while before changes are propagated. So wait a little while, go back to your GitHub settings and click the verify button to see if it works. If you want to know if and how your record shows up at all, you can use mxtoolbox.com and search for txt:yourdomain.com. That will give you the current TXT DNS records. It's not a guarantee that it will show up for GitHub that same way, again, because that's how DNS works, but it should be a pretty good indication.
If it doesn't work after a day, chances are pretty high that you didn't do something right.