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."
If you're setting up a custom domain for your GitHub Pages site, choose a supported custom domain for the easiest setup and more support. GitHub Pages is designed to work with two types of custom domains: apex domains and subdomains.
In this article:
- Apex domains
- Further reading
We recommend choosing a supported custom domain because unsupported custom domains are not guaranteed to work and may require a domain forwarding service or extra setup with your DNS provider.
These supported custom domains are optimized for GitHub Pages. The most recommended custom domain types are bold.
|Supported custom domain type||Example domain|
|one apex domain & one
Tip: We recommend using a
www subdomain as your custom domain. If you choose to use an apex domain as your custom domain then we recommend setting up a
www subdomain as well. To learn why, see "www subdomains"
The term subdomain has two common meanings:
A customizable and optional part of a domain name located before the root or apex domain that looks like a domain prefix.
A type of domain that contains a subdomain part.
To avoid confusion, custom domains with different subdomain parts are assigned different labels. A custom domain without a subdomain part, such as
example.com, is called an apex domain.
|Subdomain||Subdomain part||Subdomain type|
www subdomain is the most commonly used type of subdomain, in which the
www stands for World Wide Web. For example,
www.example.com is a
www subdomain because it contains the subdomain part
We strongly recommend that you use a
www subdomain for these reasons:
- It gives your GitHub Pages site the benefit of our Content Delivery Network.
- It is more stable because it is not affected by changes to the IP addresses of GitHub's servers.
- Pages will load significantly faster because Denial of Service attack protection can be implemented more efficiently.
A custom subdomain is a type of subdomain that doesn't use the standard
www subdomain part. It is commonly used to manage different host locations or computer servers. For example,
blog.example.io may be hosted on a different computer server than
photos.example.io. GitHub Pages supports one custom subdomain per pages site.
Setting up subdomains
A subdomain is configured with a
CNAME record through your DNS provider.
To learn more about setting up a subdomain, see one of these articles:
- Setting up a
- Setting up an apex domain and
- Setting up a custom subdomain
An apex domain is a root domain that does not contain a subdomain part. Apex domains are also known as base, bare, naked, root apex, or zone apex domains. In DNS provider settings apex domains are sometimes symbolized by an
@ symbol. For example:
example.comis an apex domain because it doesn't have any subdomain parts.
www.example.comis not an apex domain because it contains the subdomain part
Setting up apex domains
An apex domain is usually configured with an
ANAME record through your DNS provider.
To learn more about setting up an apex domain, see one of these articles:
Tip: If you are using an apex domain as your custom domain, we recommend setting up a
www subdomain as well. To learn more, see "Setting up an apex domain and