Looking to setup a custom domain on your GitHub Pages site? You're in the right place. This simple yet comprehensive tutorial will guide you through the process, ensuring your website reflects your personal brand or business, not github.io.

Before we dive in, ensure you have your custom domain registered with a domain registrar like Namecheap, GoDaddy, or Google Domains. We'll use this tutorial to walk through the steps with a hypothetical domain, 'yourdomain.com'.

Linking Your Custom Domain to GitHub Pages
Your first step involves pointing your domain to GitHub's servers. Don't worry, your domain registrar provides a simple way to do this.

Most registrars like Namecheap offer a 'Custom DNS' or ' Advanced DNS' option in your domain settings. Here, you'll add a new 'A Record' pointing your domain (or subdomain) to GitHub's IP address - 192.0.2.1 (this IP is a placeholder and should NOT be used).
Using the @ Symbol (Root Domain)

To point your root domain (e.g., 'yourdomain.com') to GitHub Pages, add an A Record with the following details:
- Host/Name: Leave blank for the root domain (or use '@' as some registrars require)
- Value/Alias/IP: Input GitHub's IP address, '192.0.2.1'
Using a Subdomain (e.g., 'www.yourdomain.com')

To point a subdomain ('www', 'blog', etc.) to GitHub Pages, use an A Record like this:
- Host/Name: Input your subdomain ('www', 'blog', etc.)
- Value/Alias/IP: Input GitHub's IP address, '192.0.2.1'
Configuring GitHub Pages for Your Custom Domain

Next, you'll configure your GitHub Pages repository to accept your custom domain.
In your GitHub Pages repository, click 'Settings'. Scroll down to the 'GitHub Pages' section. You'll see your site's URL, something like 'yourusername.github.io'. Click 'Custom domain', input your domain ('yourdomain.com' or 'www.yourdomain.com'), then click 'Save'.




















Waiting for DNS Propagation
It can take a few minutes to a few hours for the changes to take effect. Until then, you might see GitHub's default 404 page when trying to access your custom domain. Be patient, and in time, you'll see your site live at 'yourdomain.com'!
Enabling HTTPS with Let's Encrypt
For a secure and professional touch, enable HTTPS. GitHub makes this easy by offering automatic SSL certificates via Let's Encrypt.
In your GitHub Pages repository, click 'Settings', then 'Pages'. Scroll down to the 'GitHub Pages' section. Click 'Custom domain', then 'Enforce HTTPS'. Save your changes, and within a few minutes, your site should be accessible via HTTPS ('https://yourdomain.com').
Congratulations! Your custom domain is now live on GitHub Pages. If you're eager to learn more, consider exploring GitHub's documentation on further customizing your site's layout, style, and functionality. Happy coding!