What Pork Bun is and why you'd connect it to GitHub

Pork Bun is a domain registrar — the company where you buy and manage your domain name (like yoursite.com). GitHub Pages is a free hosting service that turns a GitHub repository into a live website. Connecting them means pointing your Pork Bun domain to the GitHub Pages server so visitors who type your domain name actually reach your site.

You need this connection because buying a domain and building a site are separate steps. The domain registrar (Pork Bun) holds the domain itself. GitHub Pages holds the website files. Without connecting them, people can reach your site only by typing the long GitHub URL — not your clean domain name.

The connection happens through DNS records — instructions that tell the internet where your domain should point. You create these records in Pork Bun's control panel, and they tell browsers to look for your site on GitHub's servers.

Key Takeaways

  • You need a GitHub repository with your site files and a Pork Bun domain before you start the connection process.
  • The connection happens by adding DNS records in Pork Bun's control panel that point to GitHub's servers.
  • GitHub Pages requires you to add a CNAME file to your repository that contains your domain name.
  • DNS changes can take up to 48 hours to spread across the internet, though they often work within minutes.
  • You can test the connection by checking your DNS records and visiting your domain in a browser.

Set up your GitHub Pages repository first

Before you touch Pork Bun's settings, your GitHub repository needs to be ready. Create a repository named username.github.io (replace "username" with your actual GitHub username). This naming convention tells GitHub that this repository should become a website.

Push your site files to this repository — your HTML, CSS, JavaScript, and any other files that make up your site. If you're starting from scratch, a single index.html file is enough to test the connection. GitHub Pages will automatically build and host whatever is in this repository.

Go to your repository's Settings tab, scroll to the "Pages" section on the left sidebar, and confirm that the source is set to "Deploy from a branch" with the branch set to main (or master, depending on your setup). This tells GitHub to publish your site from the files in that branch.

Add a CNAME file to your GitHub repository

GitHub needs to know which domain name you're connecting. Create a file called CNAME (no file extension) in the root of your repository. Inside this file, type only your domain name — for example, yoursite.com — and nothing else. No http://, no www, just the domain.

Commit and push this file to your main branch. GitHub will read this file and expect incoming traffic from that domain name. If you forget this step, GitHub won't recognize your domain when traffic arrives, and visitors will see an error.

If you're using GitHub's web editor, click "Add file" → "Create new file", name it CNAME, paste your domain, and commit. If you're working locally, create the file in your project folder, add it to git, and push it up.

Find your DNS records in Pork Bun's control panel

Log into your Pork Bun account and find the domain you want to connect. Click on it to open the domain management page. Look for a section called "DNS" or "Nameservers" — the exact label varies, but it's where you manage the records that point your domain elsewhere.

Pork Bun may have pre-filled DNS records pointing to Pork Bun's own servers. You're about to replace some of these with records that point to GitHub instead. Don't delete everything — you'll only change the records that direct traffic to your site.

Look for a button or link that says "Edit DNS Records" or "Manage DNS". This opens the interface where you'll add or modify the records that connect your domain to GitHub.

Add the DNS records that point to GitHub

GitHub Pages uses four A records to handle traffic. In Pork Bun's DNS editor, you need to add or modify the A records with these IP addresses:

  • 185.199.108.153
  • 185.199.109.153
  • 185.199.110.153
  • 185.199.111.153

For each IP address, create an A record. The "Name" or "Host" field should be @ (which represents your root domain, like yoursite.com). Leave the TTL (time to live) at its default, usually 3600 seconds. Save each record.

If you want www.yoursite.com to also work, add a CNAME record with the name www and the value username.github.io (your GitHub Pages URL). This tells the internet that www.yoursite.com should point to the same place as yoursite.com.

After you save these records, Pork Bun will display them in your DNS settings. The changes don't take effect immediately — they propagate across the internet's DNS servers over time.

Wait for DNS propagation and test the connection

DNS changes can take anywhere from a few minutes to 48 hours to fully propagate, though most changes work within 15 minutes. During this time, some people may reach your old site while others reach your new GitHub Pages site, depending on which DNS server their internet provider queries.

To check if your records are live, use a DNS lookup tool like MXToolbox (mxtoolbox.com) or DNS Checker (dnschecker.org). Type your domain name and look for the A records. If they show the four GitHub IP addresses, your DNS records are live.

Once the records are live, visit your domain in a browser. You should see your site. If you see a GitHub 404 error or a blank page, check that your CNAME file is in your repository and that your repository is named correctly (username.github.io).

GitHub also provides a visual indicator in your repository's Pages settings. Once the domain is connected, you'll see a green checkmark next to your domain name, confirming that GitHub recognizes the connection.

Troubleshoot common connection problems

If your domain doesn't reach your site after an hour, the most common cause is a missing or incorrect CNAME file. Check that the file exists in your repository root, contains only your domain name with no extra text, and is spelled exactly right. Commit any changes and wait a few minutes for GitHub to re-read the file.

If you see a security warning in your browser (a padlock with a warning), your HTTPS certificate hasn't been issued yet. GitHub automatically issues free HTTPS certificates through Let's Encrypt, but this can take up to 24 hours after the domain connects. Refresh your browser in a few hours — the warning should disappear.

If your DNS lookup tool shows the old IP addresses instead of GitHub's, your changes haven't propagated yet. Wait longer and check again. If more than 48 hours have passed and the records still show the old IPs, log back into Pork Bun and verify that you saved the records correctly — sometimes a typo in an IP address prevents the change from taking effect.

If www.yoursite.com works but yoursite.com doesn't (or vice versa), you're missing one of the CNAME records or A records. Add the missing record and wait for propagation.

Frequently Asked Questions

Do I have to use Pork Bun's nameservers, or can I use GitHub's?

You can use either approach. The method described here keeps Pork Bun as your nameserver and adds DNS records that point to GitHub. Alternatively, you can change your nameservers to GitHub's own nameservers, but that's more complex and unnecessary for most people. Stick with Pork Bun's nameservers and just add the A records.

What if I want to use a subdomain like blog.yoursite.com instead of the root domain?

Create a CNAME record (not an A record) with the name blog and the value username.github.io. Then update your CNAME file in the GitHub repository to say blog.yoursite.com. GitHub will then expect traffic from that subdomain instead of the root domain.

Can I connect multiple domains to the same GitHub Pages site?

You can point multiple domains to GitHub, but only one domain can be set in your CNAME file at a time. The domain in the CNAME file is your primary domain. Other domains will redirect to it or show an error. For multiple domains, you'd typically set up redirects at the registrar level or use a different hosting approach.

How do I know if my DNS records are actually pointing to GitHub?

Use a DNS lookup tool and search for your domain. Look at the A records — they should show the four GitHub IP addresses listed above. If they show different IPs, your records either haven't propagated yet or you entered them incorrectly in Pork Bun.

What happens if I delete the CNAME file from my repository?

GitHub will stop recognizing your domain, and visitors will see a 404 error when they visit it. The DNS records in Pork Bun will still point to GitHub, but GitHub won't accept the traffic. Always keep the CNAME file in your repository as long as you want the domain to work.