Development · 7 min read

How to Add Custom Domain to GitHub Pages?

GitHub Pages is a fantastic platform to host a static website, and it’s even better when you can add your custom domain to it. Adding a custom domain gives your website a professional look and makes it easier for users to find. In this guide, we will cover how to add a custom domain to your GitHub Pages website step by step.

Prerequisites

Before you start, you need to have the following:

Step 1: Verify Ownership of Your Domain

You must verify that you own the domain to add a custom domain to your GitHub Pages website. You can add a specific file, called a DNS record, to your domain’s DNS configuration. The process is different for different domain providers, so we’ll include detailed guides for some of the most popular providers.

Step 2: Add Your Custom Domain in GitHub

Once you’ve verified ownership of your domain, you can add your custom domain to your GitHub Pages website. To do this, you need to go to the repository settings of your GitHub Pages website and add your custom domain under the “GitHub Pages” section.

Step 3: Add a CNAME and A Record

A CNAME and A record is a DNS record that tells visitors to your website where to find your content. To add a CNAME and A record, you need to access your domain’s DNS configuration and add a record that points to your GitHub Pages website. The exact process for adding a CNAME and A record is different for different domain providers, so be sure to follow the instructions specific to your provider.

Also, it is recommended to check GitHub’s official guide for the updated IPs for the A record.

Specific Guides for Different Domain Providers

Here are specific guides for adding a custom domain to your GitHub Pages website for some popular domain providers:

GoDaddy

185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153

Namecheap

185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153

HostGator

185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153

Step 4: Wait for DNS Propagation

Once you’ve added your custom domain and CNAME record, you need to wait for the changes to propagate. This can take anywhere from a few minutes to 24 hours. You can check if the changes have been propagated by using a tool like DNSChecker.

Conclusion

Adding a custom domain to your GitHub Pages website is a straightforward process that can take your website to the next level. Following the step-by-step guide in this article, you can add a custom domain to your GitHub Pages website and give your users a professional and easy-to-remember address to access your website. Don’t forget to follow the specific instructions for your domain provider to ensure a smooth process. Good luck!

Share:

Your Friday WooCommerce briefing

What changed this week, what broke, and what you should try. Plugin news, store fixes, and opinions. No fluff, no affiliate spam.

Sent every Friday. Unsubscribe in one click.

This blog is independent and ad-free. If a post saved you time or taught you something new, a coffee goes a long way.

Have thoughts, questions, or a different take? I'd love to hear from you.

Powered by Giscus · Sign in with GitHub to comment. · Privacy policy