Custom Domains
Learn about setting up custom domains for GitHub Pages
Custom Domains with GitHub Pages
GitHub Pages allows you to use a custom domain name for your site instead of the default username.github.io
URL.
Setting Up a Custom Domain
- Purchase a domain: Get a domain from a registrar
- Configure DNS: Set up DNS records
- Add domain to GitHub: Configure in repository settings
- Verify domain: Confirm ownership
DNS Configuration
www.example.com)
For a subdomain (Create a CNAME record pointing to your GitHub Pages URL.
For an apex domain (example.com)
Create A records pointing to GitHub's IP addresses.
💡Tip
GitHub recommends using a subdomain (www) for better performance and reliability.