Skip to content

Using a Custom Domain

jmeade11 edited this page Oct 7, 2018 · 2 revisions

Using Your Custom GoDaddy Domain with GitHub Pages

Step 1

After signing into your GoDaddy.com account, choose the Manage Domains option from your account page or the account dropdown at the top of the home page.

After signing in go to Manage Domains


Step 2

On the My Domains page, click the ellipsis that follows your domain name you want to use.

From My Domains, click the link that appears as an ellipsis


Step 3

From the dropdown menu that appears, choose Manage DNS

Choose Manage DNS from the dropdown list


Step 4

If your domain is not currently hosted on another server, you will see that there is what's known as an A record for your domain with a value of Parked. A Records are simply a type of DNS record used to point a domain or subdomain to an IP address. The value of Parked indicates that the domain is not currently in use.

The DNS Management page for your custom domain


Step 5

We need to edit this A record by replacing the value of Parked with the IP address for GitHub's servers. To do this, click on the pencil icon on the far right of the record entry in the list and replace the word parked in the Points to field with 192.30.252.153. Click Save to save your changes.

Edit the A record with the IP address for GitHub's servers


Step 6

Next, we need to create another A record because GitHub has two servers that manage all of the traffic to it. Click the ADD button at the bottom right of the list of records for your domain and choose A from the Type field select list. In the Host field enter @. The @ symbol means 'the current origin', or more simply put, for your domain. In the Points to field enter the second server address of 192.30.252.154. Now, choose the Custom option from the TTL select field. TTL stands for Time to Live and it tells the nameservers that they should only cache this IP address for a specific period of time. If the address is changed by you in the future because you move your site to a different server, you would want that change to be immediate, so we'll use the value of 600 in the Seconds field.

Edit the A record with the IP address for GitHub's servers


Step 7

The last thing we're going to do here is create a CNAME record. A CNAME record is a type of DNS record that maps an alias name to actual (or canonical, hence the C in CNAME) domain name. So, once again click the ADD button at the bottom right of the list of records for your domain, but choose CNAME from the Type field select list this time. With this record we are going to make sure that if someone types www.your-custom-domain.com that the traffic is also routed to your site. Therefore, in the Host field, enter www and then in the Points to field, enter your GitHub pages url. For the purposes of the CNAME record, you can leave the default value of 1 Hour in the TTL field.

Add a CNAME record for www traffic to your site


Step 8

Almost done... now you can go to your GitHub repo for your GitHub Pages site. It will be at: github.com/yourusername/yourusername.github.io. On the Code tab, click the button that reads Create new file.

Add a CNAME record for your domain


Step 9

Name your new file: CNAME. Make sure it is in all capital letters and has no additional punctuation or characters in the name and add the name of your domain on the first line

Add a CNAME record for your domain


Step 10

Click the Commit button at the bottom of the page. 🎉

Add a CNAME record for your domain

It may take several minutes for the updates to take effect. Test out your new custom domain!