---
title: "How to Use a Custom Domain with GitHub Pages"
description: "In our previous GitHub Pages article, we showed you how you can create a static site and host it in your GitHub repository. This is a simple option for creating a site—with considerable..."
url: https://www.inmotionhosting.com/support/domain-names/how-to-use-a-custom-domain-with-github-pages/
date: 2018-02-21
modified: 2021-11-26
author: "Christopher Maiorana"
categories: ["Domain Names"]
type: post
lang: en
---

# How to Use a Custom Domain with GitHub Pages

![Custom domain with GitHub Pages](https://www.inmotionhosting.com/support/wp-content/uploads/2021/11/Custom-Domain-GitHub-Pages-1024x538.png)

In our previous [GitHub Pages article](/support/website/git/host-site-github-pages/), we showed you how you can create a static site and host it in your GitHub repository. This is a simple option for creating a site—with considerable limitations.

Your GitHub Pages site will have its own URL based on your username and the name of the repository. However, you may want to use a custom domain. In this article, we’ll show you **how to use a custom domain with GitHub Pages**.

In order for this tutorial to be relevant to you, you must make certain that you have the following:

- A [registered domain](/support/domain-names/)
- Nameservers for the [domain pointing to InMotion Hosting](/support/domain-names/changing-your-domains-nameservers/)

You will not be able to use [SSL](/support/amp/how-do-i-obtain-an-ssl-certificate/) with on this domain. If you need an SSL for your site, you should consider using a [complete hosting plan](https://www.inmotionhosting.com/).

## Add a Custom Domain to Your Repository

Now, we will need to first add our custom domain to our GitHub repository. This will set up a record there, but the change will not take effect until we add the necessary DNS records to [cPanel](/support/edu/cpanel/how-to-log-into-cpanel/).

1. Log into your GitHub account
2. Select **Settings** under your repository
3. Add your custom domain under the *Custom domain* section and click **Save**

A custom domain has now been added to your repository. Below, we’ll show how to add an A record in your cPanel that will point to GitHub.

## Add A Records to Point Your Domain to GitHub

Now that we have added the necessary domain information to our GitHub account, we are going to create custom domain records in cPanel. This is like adding a physical address to your name in a phonebook. We will be pointing our domain to GitHub’s IP addresses.

1. Check out our full tutorial on [adding an A Record](/support/domain-names/dns-nameserver-changes/a-record-change/) for cPanel
2. Create one A Record for 192.30.252.153
3. Create another A Record for 192.30.252.154

If your domain is not pointing to InMotion Hosting, you should be able to add DNS records at your registrar. Once these records have been created, allow at least 4-24 hours for the changes to propagate across the web.
