Recently I set up a new website for a new project of mine. I wanted to use GitHub Pages for the website and Read the Docs for the documentation, both with the same custom domain (and a subdomain of that custom domain):
If you are an experienced DNS record creator, you probably know exactly how to do this and don’t need the information in this post at all.
But I never messed with DNS settings before, and apparently some things are varying depending on your provider, so I got stuck in the middle and had to resolve to Google and my provider’s support.
My provider is all-inkl.com, and here are the default DNS settings in their admin panel:
Read the Docs
The Read the Docs part was easy and straightforward.
I followed the documentation and created a CNAME record named
docs which points to
The GitHub Pages documentation about custom domains tells me to:
- either create an
ANAMErecord or, if that’s not possible, two
Arecords for the actual domain
- create a
CNAMErecord for the
This is where I got stuck - my provider doesn’t support
ANAME records, so I had to fall back to the second option - creating two
If you take a look at the default DNS settings on the screenshot at the top, you can see that there are already two
A records pointing to the same IP: one without name, and one named
The one named
* is a wildcard record, which is in sync with the first record: it’s not possible to change the wildcard record itself, and changing the first record automtically changes the wildcard record as well.
So after changing the existing
A record (and the wildcard record) to the first IP provided by GitHub, the domain already resolved to the GitHub Pages site.
But the GitHub help provides two IPs, so I tried to create a second
A record without a name for the second IP. This failed because according to the error message, “this record already exists”.
At this point (and after reading the docs of both GitHub Pages and my provider, and some Googling) I emailed my provider’s support and Github support, and now I know:
My provider supports only one
For a custom domain to successfully resolve to GitHub Pages, it’s sufficient to create an
Arecord for one of GitHub Pages’ two IPs.
Arecord for the second IP isn’t strictly necessary, GitHub provides the second IP just for availability.
CNAMErecord for the
wwwsubdomain needs to point to
christianspechtis my GitHub username), even though the repo with my site is not a user page repo.
I was confused at first because according to this chart I thought I needed to point to
christianspecht.github.io/scm-backup-site, but the guy from GitHub support told me:
Our Pages servers automatically handle routing requests to the correct repository based on your custom domain, so you’ll just have to use
The finished settings
Here are my current DNS settings:
I understand that setting only one
A record is not the ideal solution and may result in my site being offline, should
220.127.116.11 be ever unavailable (and
18.104.22.168 still be available).
But this is for a new project, I don’t know if it will ever take off, and the plan that I’m paying my provider anyway for includes five domains…so this domain is actually free for me.
So right now I won’t move it to a different provider (and pay for it) just for the ability to set a second