As described in earlier posts, I host this website and blog using GitHub Pages. I also host using GitHub pages from the same GitHub account. Recently, I decided to start using a custom domain for this website. I found the GitHub documentation for how to do so to be somewhat confusing, and found other people struggling with the same issue, but did not find the solution posted anywhere, so I decided I should write down what I ended up doing.

Some of the GitHub documentation is ambiguous, and makes it sound to me as if it might not be possible to use multiple custom domain names with a single user accounts. Examples in the documentation use a single custom domain with different repositories being mapped to different subdomains or directories under a domain.

Fortunately, GitHub does support different custom domains for each repository. Setting them up is relatively simple once you know what to do, though figuring it out by trial and error can be problematic since errors will take your site down and take some time to fix due to the time it takes for DNS updates to propagate. Some of my readers may have noticed that had some downtime while I was figuring this out.

Suppose we wish to take the GitHub pages hosted at and have them appear at, for multiple values of n. The solution is: * Using your domain name registrar (I use, for each * Add an A record with host @ and value Some of the GitHub documentation seems to discourage the A record approach, but it is the only approach that worked for me. * Add an A record with host @ and value * Add a CNAME record with host www and value Yes, there is supposed to be a . at the end of the value. Some pages of the GitHub documentation seem to suggest that multiple domain names will not all be support if they have a CNAME Record pointing to the same user account, but this is fortunately not the correct interpretation of the documentation. * You may also wish to add a URL redirect record so that will take you to * On GitHub, for each repository, add the corresponding custom domain in the repository’s settings.

Using this approach, I was able to link to and to .