how to point domain name to github pages

Point Domain Name to GitHub Pages

By James Jones
AD

Are you eager to host your personal portfolio or project website using GitHub Pages, but aren't sure how to point your custom domain to it? You're in the right place. In this comprehensive guide, we'll walk you through the process, ensuring it's simple, secure, and SEO-friendly.

First, let's understand what we're trying to achieve. GitHub Pages allows you to create a static website using your GitHub repositories. However, the default URL is a GitHub Pages subdomain. By pointing your custom domain, you can make it appear as if your website is hosted independently, boosting your professionalism and search engine ranking.

Registering Your Domain Name

Before we proceed, ensure you have registered a domain name with a domain registrar like GoDaddy, Namecheap, or Google Domains.

AD
How To Get a Free Domain Name for Your Website In 2026?
How To Get a Free Domain Name for Your Website In 2026?
8 Sites to Help Choose a Unique Domain Name
8 Sites to Help Choose a Unique Domain Name
9 Best Domain Name Generators in 2026
9 Best Domain Name Generators in 2026

For this guide, let's assume you've registered "yourcustomdomain.com" with GoDaddy.

Updating Name Servers

To connect your domain with GitHub, you need to update your domain's name servers to point to GitHub's name servers. This tells the internet where to look for your website's files.

How To Setup Custom Domain On Tumblr | Buy Own Domain - Meer's World
How To Setup Custom Domain On Tumblr | Buy Own Domain - Meer's World
How to Register a Domain Name for your Website? [Free Guide]
How to Register a Domain Name for your Website? [Free Guide]

Here's how to do it in GoDaddy:

  • Log in to your GoDaddy account and go to your "My Products" page.
  • In the "Domains" section, select "Manage" for the domain you want to connect to GitHub.
  • Scroll down to the " Nameservers" section, select "Manage".
  • Choose "Custom" and enter GitHub's name servers:
    • ns-1580.aws.digitaloceans.com
    • ns-1068.aws.digitaloceans.com

Verifying Domain Ownership

Next, you need to prove that you own the domain. This step is crucial for security and to prevent anyone else from claiming your domain.

AD

Here's how to do it in GitHub:

  • Log in to your GitHub account and go to your repository's settings page.
  • Scroll down to the "GitHub Pages" section and click "Edit".
  • Under "Custom domain", enter your domain (e.g., "yourcustomdomain.com").
  • Click "Save" to add a CNAME file to your repository's root.

You've just set the stage for directing your domain to GitHub Pages. Now, let's finalize the process.

Configuring DNS Settings

With the name servers updated and domain ownership verified, you need to tweak your DNS records to direct traffic to your GitHub Pages site.

AD

Here's how to do it in GoDaddy:

Setting Up an A Record

An A record maps your domain to an IP address. You'll need to add an A record that points '@' to 'IPv4: 185.199.108.153' and another one that points 'www' to 'IPv4: 185.199.109.153'.

  • In your domain management page, scroll down to the "DNS Management" section and click "Edit".
  • Click "Add" to create a new record, select "A" and enter '@' as the "Host", and '185.199.108.153' as the "Points to" field. Click "Save".
  • Repeat the process to create another A record with 'www' as the "Host" and '185.199.109.153' as the "Points to" field.

Setting Up a CNAME Record

A CNAME record maps your domain to another domain. This step is crucial for directing 'yourcustomdomain.com' to 'yourusername.github.io'.

AD

Note: You might have already added a CNAME record when verifying domain ownership. If so, no need to repeat this step.

  • Scroll down to the "DNS Management" section and click "Edit".
  • Click "Add" to create a new record, select "CNAME" and enter 'yourcustomdomain.com' as the "Host" (or 'www.yourcustomdomain.com' if you're creating a www record), and 'yourusername.github.io' as the "Points to" field. Click "Save".

Now, take a deep breath. You've completed all the steps to point your domain name to GitHub Pages. It might take some time for the changes to take effect, so be patient. Soon, when users visit 'yourcustomdomain.com', they'll be directed to your beautiful GitHub Pages website.

Remember, pointing your custom domain to GitHub Pages not only makes your website look more professional but also improves your SEO efforts. By directing traffic to your domain, you're making it easier for search engines to find and index your content.

So, go ahead, share your portfolio or project, and let the world know about your creations! Happy coding!

AD