Explore by product

Setting up an apex domain

GitHub Pages is available in public repositories with GitHub Free, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see "GitHub's products."

To set up an apex domain, such as example.com, you must configure an ALIAS, ANAME, or A record with your DNS provider.

Tip: If you have trouble configuring an ALIAS, ANAME or A record, then contact your DNS provider for help. They can help confirm that you have configured your custom domain correctly with their services.

Warning: Unless your DNS provider supports CNAME flattening, don't create a CNAME record for your custom apex domain. Doing so may cause issues with other services, such as email, on that domain.

To determine which type of DNS record to configure with your DNS provider, check if your DNS provider supports ALIAS or ANAME records. We recommend configuring your apex domain with an ALIAS or ANAME record when possible because they are easier to set up and require less updating since they point your site to another domain name instead of an IP address. A records point your site to one or more IP address and require updating when the IP address changes.

Note: Some DNS providers support configuring apex domains with an ALIAS or ANAME record, but there is no industry standard for these. Only DNS Made Easy currently supports ANAME records and DNSimple is one of the few DNS providers that support ALIAS records.

Contact your DNS provider for detailed instructions on how to set up ALIAS or ANAME records.

Follow your DNS provider's instructions to create an ALIAS or ANAME record that points your apex domain to the GitHub Pages server at your default pages domain. Your DNS changes can take over a full day to update and the wait varies among DNS providers.

Note: Your default GitHub Pages domain is determined by the type of pages site you have. For examples, see this domain chart.

To confirm that your DNS record is set up correctly, use the dig command with your custom domain.
Using a custom domain as an example:

Contact your DNS provider for detailed instructions on how to set up A records.

Follow your DNS provider's instructions to create A records that point your custom domain to the following IP addresses:

185.199.108.153

185.199.109.153

185.199.110.153

185.199.111.153

Tip: Your DNS changes can take over a full day to update and the wait varies among DNS providers.

To confirm that your DNS record is set up correctly, use the dig command with your custom domain.
Using a custom domain as an example:

$ dig +noall +answer example.com
;example.com.
example.com. 3600 IN A 185.199.108.153
example.com. 3600 IN A 185.199.109.153
example.com. 3600 IN A 185.199.110.153
example.com. 3600 IN A 185.199.111.153

Your apex domain should point to the IP addresses you configured.

Add your custom domain to your GitHub Pages site. If you're updating the IP address of an existing A record, first remove and then re-add your custom domain to the repository you’re using to publish your Pages site to trigger the process of enabling HTTPS. For more information, see "Adding or removing a custom domain for your GitHub Pages site."