Pointing a Github Pages Repo to a Hover Domain
Tags: github, jekyll, tutorial
Published: 2018-07-30 01:08:02

---
title: Pointing a Github Pages Repo to a Hover Domain
published: true
description: 
tags: github, jekyll, tutorial
cover_image: https://assets-cdn.github.com/images/modules/open_graph/github-mark.png
canonical_url: https://nickymarino.com/2018/07/29/hover-github-pages/
---

*This post was originally published on [my website](https://nickymarino.com). Check it out for more awesome content!*

My blog is currently hosted using [GitHub Pages](https://pages.github.com/)&mdash;which is a great way to host your static site or blog for free&mdash;by linking it to my custom domain that I purchased through [Hover](https://www.hover.com/). While both of these services are amazing, connecting the two required many open tabs and several waiting periods. This post will explain the steps needed to point a GitHub Pages repo to a custom domain on Hover. 

## Preflight Check

Before connecting GitHub Pages to a custom domain, I first updated my blog on my repository `username.github.io`, and checked that it was displaying properly at its default website (normally `username.github.io`).

## Link the Repo to the Domain

First you need to update your repository with your custom domain. In the settings for the repo, enter the domain in the "Custom domain" in the GitHub Pages section. 

![GitHub Pages settings for the repo](https://thepracticaldev.s3.amazonaws.com/i/od8rooznh47i0cdk1cjb.png)

## A Records on Hover

The next step is to configure Hover. Find [GitHub's current list of IP addresses](https://help.github.com/articles/setting-up-an-apex-domain/#configuring-a-records-with-your-dns-provider) to create records with. Then, go to your [Hover](https://www.hover.com/) account, select your domain, and go to the DNS tab) to add to the DNS tab on Hover. At the time of writing, these are:

```
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
```

Then, go to your [Hover](https://www.hover.com/) account, select your domain, and go to the DNS tab. Delete any DNS records that have an "A" under "Records".

For each IP address on GitHub's help pages, add a DNS record. For each, the "Type" will be `A`, the "Hostname" will be `@`, and the "TTL" can be left as the default value.

You'll also want to create a record with Type `CNAME`, Host `www`, and value `[username].github.io`, so that your site can be reached via www.yoursite.com. The final set of values should look like the ones below:

![Hover DNS settings](https://thepracticaldev.s3.amazonaws.com/i/wdum3ad7p2v27j0l1cmw.jpg) 

It may take several hours (or up to about a day) for the changes to take effect. Take a break, get some sleep, and then come back to your domain to make sure everything's working. Now we can enforce HTTPS!

## CNAME File

In your GitHub repo, create a file named `CNAME` (no extension) in the root folder. In the new file, write the Hover domain you're using. *Make sure the file is only one line.* The file should resemble the one below:

![CNAME Contents](https://thepracticaldev.s3.amazonaws.com/i/vrra7gnvb37knc9vndpg.jpg)

## Create HTTPS certificate

If you head back to your repo's settings page to enforce HTTPS, you might see the following "not yet available" error:

![GitHub Pages HTTPS error](https://thepracticaldev.s3.amazonaws.com/i/gkyyfaxohna4aw08w5qv.png)

Per [GitHub's troubleshooting page](https://help.github.com/articles/troubleshooting-custom-domains/#https-errors), you need to remove and then re-add your custom domain for your repository. Wait around 24 hours for the certificate to be generated, and you should be good to go!

_Edit:_ Thanks to [David Ryan](https://dev.to/davedri/comment/8m9l) for pointing out that I was missing the CNAME record!