Explore by product

Setting up a custom subdomain

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."

You can set up a custom subdomain, such as blog.example.com, by creating a CNAME record through your DNS provider.

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

Contact your DNS provider for detailed instructions on how to set up the subdomain you added to your repository's CNAME file.

Follow your DNS provider's instructions to create a CNAME record that points your subdomain to your default pages domain. For example, if you own the subdomain www.example.com, you can configure a CNAME record to point www.example.com to YOUR-GITHUB-USERNAME.github.io. DNS changes can take over a full day to update, and the wait varies among DNS and hosting providers.

Danger: Do not use wildcard DNS records (e.g. *.example.com) with GitHub Pages! A wildcard DNS record will allow anyone to host a GitHub Pages site at one of your subdomains.

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: