I want to set up my GitHub pages user page to use a custom apex domain and www subdomain, as described in the GitHub pages help. I have it working via A and CNAME records (see below), but GitHub recommends using ANAME records instead. My Domain Name Registrar, Name.com, appears to support ANAME records, but I can't get them to work.

I have a website hosted on GitHub pages that is (I think) correctly configured using A records and a CNAME record. For my apex domain example.net, I have four A records for example.net (one for each of the 4 IP addresses specified in the Github help pages) and one CNAME record that redirects the subdomain www.example.net to my actual GitHub user page (example.github.io).

I tried replacing the A records with a single ANAME record to redirect example.net to example.github.io, but it made my page inaccessible... so I presume I set it up wrong. I'm wondering if I need to specify something other than my user page url for the ANAME redirect (i.e., something other than example.github.io).

Can anyone advise on the correct way to set up an ANAME record for GitHub Pages via Name.com?

  • No experience with name.com but you could consider using Cloudflare. I have two sites working that way (Cloudflare + Github Pages) and everything is fine. – Emirodgar May 18 '18 at 7:06
  • "ANAME record to redirect example.net to example.github.io" -- DNS records can't do redirects. At best your DNS record can point to the same thing as something else. It would be more accurate to say "ANAME record to point example.net to example.github.io". The web server is responsible for all redirects once the request is received at that server. – Stephen Ostermiller May 20 '18 at 9:42
  • The problem is probably at GitHup Pages. How have you configured GitHub Pages so that it knows what to do when it receives a request for example.net? – Stephen Ostermiller May 20 '18 at 9:44
  • CNAME record(in DNS setting) will not going to make any redirection.....If you remove it, and deploy your CNAME file(Or doing manually in repository setting) which contain only your apex domain name then it will do automatic redirection from www subdomain to your apex domain. But still if you want to redirect to github subdomain(github.io) then use domain forward service not CNAME records. – Goyllo May 20 '18 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.