How to Connect Porkbun to GitHub Pages: A Complete Setup Guide

If you've registered a domain through Porkbun and built a site using GitHub Pages, connecting the two is a straightforward DNS configuration task — but it requires understanding what's actually happening under the hood. This guide explains the process, the variables that affect how it works, and what to watch for depending on your setup.

What "Connecting" Porkbun to GitHub Actually Means

When people say they want to connect Porkbun to GitHub, they typically mean one of two things:

  • Pointing a custom domain (registered at Porkbun) to a site hosted on GitHub Pages
  • Using a subdomain (like www.yourdomain.com) rather than the default username.github.io address

The connection happens through DNS records — instructions that tell the internet where to send visitors when they type your domain into a browser. Porkbun manages those DNS records; GitHub Pages receives the traffic. The two services don't have a direct integration. You're simply updating DNS settings on Porkbun's side and configuring GitHub to accept traffic for your custom domain.

Step 1: Configure GitHub Pages to Accept Your Custom Domain

Before touching DNS, set up GitHub first.

  1. Go to your repository on GitHub
  2. Navigate to Settings → Pages
  3. Under Custom domain, enter your domain (e.g., yourdomain.com or www.yourdomain.com)
  4. Save the setting — GitHub will create a CNAME file in your repo automatically

GitHub will also attempt to verify your domain and provision an SSL certificate via Let's Encrypt, but this only completes after DNS is pointed correctly.

Step 2: Add DNS Records in Porkbun

Log in to your Porkbun account, navigate to your domain, and open DNS Records.

For an Apex Domain (yourdomain.com)

GitHub recommends adding four A records pointing to GitHub's IP addresses:

Record TypeHostAnswer
A@185.199.108.153
A@185.199.109.153
A@185.199.110.153
A@185.199.111.153

The @ symbol represents your root domain. Adding all four IPs provides redundancy across GitHub's global network.

For a www Subdomain

Add a CNAME record:

Record TypeHostAnswer
CNAMEwwwyourusername.github.io

If you want both yourdomain.com and www.yourdomain.com to work, configure both the A records and the CNAME record.

🔍 A Note on Porkbun's Default Records

Porkbun often pre-populates domains with default DNS records (including parking page A records). Before adding new records, delete any existing A records pointing to Porkbun's placeholder IPs, or your domain won't resolve to GitHub correctly.

Step 3: Wait for DNS Propagation

DNS changes don't take effect instantly. Propagation typically takes anywhere from a few minutes to 48 hours, depending on your ISP, region, and how aggressively DNS caches are held by resolvers worldwide.

You can check propagation status using tools like whatsmydns.net or dnschecker.org — these show whether your domain is resolving to the correct GitHub IPs across different global servers.

Once propagation is complete, GitHub will finalize SSL provisioning. You can monitor this under Settings → Pages in your repository. If SSL takes longer than 24 hours after DNS propagates, disabling and re-enabling the custom domain setting often triggers a retry.

Variables That Affect How This Setup Works

Not every Porkbun-to-GitHub connection behaves identically. Several factors shape your experience:

Repository type — A user/organization site (username.github.io) behaves differently from a project site (username.github.io/project-name). Project sites hosted at a path may require additional configuration for routing to work correctly under a custom domain.

HTTPS enforcement — GitHub Pages offers an option to enforce HTTPS after the SSL certificate is provisioned. If you're redirecting HTTP to HTTPS, both DNS and the certificate need to be fully in place first.

Porkbun's CDN/proxy features — Porkbun offers optional CDN and URL forwarding features on some domains. If any forwarding rules are active on your domain, they can intercept traffic before it reaches GitHub, causing unexpected redirects or broken HTTPS.

Existing email records — If you're using Porkbun's email hosting or forwarding for the same domain, your MX records are separate from A/CNAME records and won't be affected by this change. That said, it's worth verifying email still works after any DNS update.

TTL settings — Porkbun allows you to set the TTL (Time to Live) for DNS records, which controls how long resolvers cache the values. Lower TTL values mean faster propagation when making changes, but Porkbun's defaults are generally reasonable for most users.

🧩 Apex vs. Subdomain: The Practical Difference

SetupRecords NeededTypical Use Case
Root domain (domain.com)4 × A recordsClean, professional URLs
www subdomain only1 × CNAMESubdomain-first preference
Both root + wwwA records + CNAMEMaximum compatibility

GitHub officially recommends configuring both so visitors reach your site regardless of whether they type www or not.

Where Individual Setups Start to Diverge 🛠️

The technical steps above cover the standard path — but what works cleanly in one setup can require troubleshooting in another. Whether you're managing a simple static portfolio, a documentation site, a project page nested under a repo path, or a domain with active email and other subdomains already configured, the interaction between your existing DNS records and what GitHub expects can look quite different. The base configuration is universal; what sits around it is specific to your domain's history and how Porkbun has been set up over time.