After some (mis)adventures, I finally got my custom domain name directed to my GitHub Pages site successfully. Here is what worked, in case someone else has the same problem.

I first tried clearing all of my DNS records and adding only the ones I thought I needed. Don’t do that. I got a “Nameserver is not authoritative” error, and didn’t know how to get back to the defaults.


GitHub Pages Configuration

To use GitHub Pages, all you have to do is create a public repo and turn on GitHub Pages at the bottom of ‘Settings’. However, I highly recommend using the default GitHub Pages repo name ( so that the hosted website is just without a trailing folder name. This means that root-relative-urls (/assets/css/styles.css) will work consistently locally, hosted at GitHub, and hosted at CloudFlare Pages.

You choose the branch to publish in the GitHub repo Settings page. I’m choosing a ‘release’ branch, so that I can work directly in main and push frequently to back up but not publish half-finished work.

Also, don’t turn on ‘Enforce HTTPS’ initially - get your domain working correctly first.


See Managing a custom domain for your GitHub Pages site - GitHub Docs for the official documentation. It was good, but didn’t fully tell me which DNS records I needed to get things working.

DNS Record Configuration

After my misadventure, Support was able to restore the defaults for me.

After that, here are the changes that worked:

  1. Record the default types, names, and values, in case you need to replace them.
  2. Remove the ‘@’ and ‘*’ A records and the ‘_acme-challenge’ CNAME record.
  3. Add ‘@’ A records for each of the GitHub Pages IP addresses.
  4. Add ‘www’ A records for each of the GitHub Pages IP addresses.


  1. Wait (about two hours, for me).
  2. Verify via
  3. Flush your PC DNS cache (on Windows, “ipconfig /flushdns”)
  4. Verify your domain resolves to your website in the browser.
  5. In your GitHub repo Settings, turn on “Enforce HTTPS”


… and then my site finally worked!