People with admin permissions for a repository can configure a custom domain for a GitHub Pages site.
About custom domain configuration
Tip
We recommend verifying your custom domain prior to adding it to your repository, in order to improve security and avoid takeover attacks. For more information, see Verifying your custom domain for GitHub Pages.
Make sure you add your custom domain to your GitHub Pages site before configuring your custom domain with your DNS provider. Configuring your custom domain with your DNS provider without adding your custom domain to GitHub could result in someone else being able to host a site on one of your subdomains.
The dig command, which can be used to verify correct configuration of DNS records, is not included in Windows. To verify that your DNS records are configured correctly, you can use the Resolve-DnsName PowerShell command or install BIND.
Note
DNS changes can take up to 24 hours to propagate.
Configuring an apex domain
To set up an apex domain, such as example.com, you must configure a custom domain in your repository settings and at least one ALIAS, ANAME, or A record with your DNS provider.
-
On GitHub, navigate to your site's repository.
-
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

-
In the "Code and automation" section of the sidebar, click Pages.
-
Under "Custom domain", type your custom domain, then click Save. If you are publishing your site from a branch, this will create a commit that adds a
CNAMEfile directly to the root of your source branch. If you are publishing from a custom GitHub Actions workflow, noCNAMEfile is created, and any existingCNAMEfile is ignored and is not required. For more information about your publishing source, see Configuring a publishing source for your GitHub Pages site. -
Navigate to your DNS provider and create either an
ALIAS,ANAME, orArecord. You can also createAAAArecords for IPv6 support. If you're implementing IPv6 support, we highly recommend using anArecord in addition to yourAAAArecord, due to slow adoption of IPv6 globally. For more information about how to create the correct record, see your DNS provider's documentation.-
To create an
ALIASorANAMErecord, point your apex domain to the default domain for your site. For more information about the default domain for your site, see What is GitHub Pages?. -
To create
Arecords, point your apex domain to the IP addresses for GitHub Pages.185.199.108.153 185.199.109.153 185.199.110.153 185.199.111.153 -
To create
AAAArecords, point your apex domain to the IP addresses for GitHub Pages.2606:50c0:8000::153 2606:50c0:8001::153 2606:50c0:8002::153 2606:50c0:8003::153
-
Note
If your DNS provider automatically sets a default record, remove it before continuing.