Tech Tutorials & Web Architecture

The Ultimate Zero-Cost Web Architecture: Connecting a Porkbun Domain to GitHub Pages

Angga Conni Saputra
February 24, 2026
The Ultimate Zero-Cost Web Architecture: Connecting a Porkbun Domain to GitHub Pages

In the modern web ecosystem, building a blazing-fast, secure personal portfolio or business landing page shouldn't require a monthly subscription. The secret to a truly zero-cost web architecture lies in combining two of the most developer-friendly platforms available: Porkbun for transparent, unbeatable domain pricing, and GitHub Pages for enterprise-grade, completely free static hosting backed by a global CDN. This guide walks you through every step — from DNS theory to a live, HTTPS-secured website — with nothing left out.

While legacy registrars lure you with $1 first-year deals only to lock you into $20+ renewals, Porkbun has become the go-to registrar for developers who value honesty: flat renewal pricing, free WHOIS privacy on every domain, and free SSL certificates included by default. Pair that with GitHub Pages — which serves your static site from Microsoft's global infrastructure at zero cost — and you have an architecture that rivals setups costing $200/year.

The Tech Stack Logic

The Registrar (Porkbun): You pay one flat annual fee for your domain — typically $4–$10 depending on the TLD. No upsells, no hidden renewal hikes, no "domain privacy" add-on fees. Porkbun bundles WHOIS privacy and SSL for free on every domain.

The Host (GitHub Pages): GitHub serves your static files directly from your repository using a global CDN. It includes automatic HTTPS via Let's Encrypt, 1 GB storage, 100 GB monthly bandwidth, and native CI/CD through GitHub Actions — all at $0/month.

The Result: An enterprise-grade web presence — custom domain, HTTPS, CDN, CI/CD — for the cost of a domain renewal once a year. Total recurring monthly cost: $0.00.

Before You Begin: Prerequisites Checklist

Before touching any settings, make sure you have these three things ready. This will make the entire process take about 10–15 minutes instead of an hour of troubleshooting.

User Site vs. Project Site — Know the Difference

User/Organization site: Repository named exactly yourusername.github.io. Content at root of main branch. Accessible at yourusername.github.io. Best for personal portfolios and main websites.

Project site: Any other repository name (e.g., my-portfolio). Accessible at yourusername.github.io/my-portfolio. Custom domains work the same way on both. Best for project documentation or secondary sites.

Visualizing the DNS Connection Architecture

Before diving into the steps, it's crucial to understand what we are actually doing. The Domain Name System (DNS) is the internet's phonebook. When someone types your domain into a browser, their device queries DNS to find which server to connect to. We are editing that phonebook entry inside Porkbun — telling it to point your domain to GitHub's four IP addresses for the root domain, and to your GitHub Pages URL for the www subdomain.

DNS Routing Flow: Porkbun → GitHub Pages

How traffic is directed from your custom domain to your GitHub repository via 4 A Records (root domain) and 1 CNAME (www subdomain).

👤 User Browser yourdomain.com 🃏 PORKBUN DNS Registrar yourdomain.com DNS Management 4x A Records 1x CNAME 😻 GITHUB PAGES Free Global Static Hosting GitHub IPv4 (A Records) 185.199.108.153 185.199.109.153 185.199.110.153 185.199.111.153 CNAME Target username.github.io Your Repository index.html style.css script.js CNAME

Step 1: Prepare Your GitHub Repository

The destination must be set up before you redirect traffic there. Follow these steps precisely.

1a. Create Your Repository

  1. Go to github.com, click the + icon at the top-right, and select New repository.
  2. For your main personal website, name it exactly: yourusername.github.io — replacing yourusername with your actual GitHub username. This is the magic name that activates user-level Pages.
  3. Set visibility to Public (required for free GitHub Pages).
  4. Click Create repository.

1b. Upload Your Site Files

  1. Upload your site files to the root of the repository. You must have at minimum an index.html file — this is what GitHub serves as your homepage.
  2. If you're using a framework like React, push your build output (the /dist or /out folder contents), not your source files. Raw JSX does not run on GitHub Pages.
  3. Commit your files to the main branch.

1c. Enable GitHub Pages

  1. Navigate to your repository on GitHub. Click the Settings tab (gear icon).
  2. In the left sidebar, scroll down and click Pages.
  3. Under Build and deployment, set Source to Deploy from a branch.
  4. Set Branch to main and folder to / (root). Click Save.
  5. GitHub will now build and deploy your site. After 1–2 minutes, you'll see a banner: "Your site is live at https://yourusername.github.io". Visit that URL to confirm your site loads correctly before proceeding.

1d. Add Your Custom Domain to GitHub Pages

  1. Still in Settings > Pages, scroll to the Custom domain section.
  2. Type your Porkbun domain (e.g., yourdomain.com) and click Save.
  3. GitHub will attempt a DNS verification check. It will fail immediately — this is completely expected because we haven't configured Porkbun yet. Keep this tab open.
  4. Notice that GitHub has now automatically created a file called CNAME in your repository root. This file contains your custom domain name and is essential — never delete it. If you ever rebuild your site from scratch, recreate this file manually with just your domain name as its content (e.g., yourdomain.com).

The CNAME File — Critical Detail Often Missed

The CNAME file (no extension) in your repository root tells GitHub Pages which custom domain to respond to. Its contents should be just your domain, one line:

yourdomain.com

If you use a static site generator or a CI/CD pipeline that wipes your repo on every build, add this file to your source so it gets included in every deployment automatically.

Step 2: Configure DNS Records on Porkbun

Open a new tab and log into your Porkbun account. This is where we point your domain to GitHub's servers. The entire configuration requires exactly five DNS records: four A records for the root domain (@), and one CNAME record for the www subdomain.

2a. Open the DNS Management Panel

  1. From your Porkbun dashboard, hover over your domain and click the DNS button (it looks like a world icon or a list icon next to your domain name).
  2. You'll land on the DNS Management page. Scroll down to the Current Records section.
  3. Delete any pre-existing A or CNAME records for the root (@) or www that you didn't add yourself. Porkbun often pre-populates parking page records — these will cause conflicts. Click the red trash icon to remove them. Leave MX (email) records untouched if you have them.

The 5 Required DNS Records

Enter these exact records into Porkbun's DNS Management area. The @ symbol represents your root domain. In Porkbun's interface, leave the Host field blank (empty = root).

TYPE HOST (leave blank = @) ANSWER / VALUE TTL A @ 185.199.108.153 600 A @ 185.199.109.153 600 A @ 185.199.110.153 600 A @ 185.199.111.153 600 CNAME www yourusername.github.io 600

2b. Add the Four A Records

  1. In the Add Record section at the top of the DNS panel, select Type: A — Address record.
  2. Leave the Host field completely empty. In Porkbun, an empty host field defaults to the root domain (@). Do not type @ — leave it blank.
  3. In the Answer field, paste: 185.199.108.153
  4. Leave TTL at default (600). Click Add.
  5. Repeat steps 1–4 for the remaining three IPs: 185.199.109.153, 185.199.110.153, and 185.199.111.153.

You should now see four A records in the Current Records table, all pointing to @ with different IPs. Why four? GitHub maintains multiple servers for redundancy. Your browser will use whichever responds fastest.

2c. Add the CNAME Record for www

  1. Select Type: CNAME — Canonical name record.
  2. In the Host field, type: www
  3. In the Answer field, type your GitHub Pages base URL: yourusername.github.io (no https://, no trailing slash).
  4. Click Add.

This record ensures that visitors who type www.yourdomain.com are also routed to your site correctly. Without it, the www version would return a DNS error.

DNS Propagation — Expect Up to 24 Hours

DNS changes are not instantaneous. Once you save records in Porkbun, those records need to propagate to DNS resolvers (essentially: caches at your ISP and around the world) before GitHub can verify them.

Porkbun is exceptionally fast — in practice, propagation often takes 5–30 minutes. But globally, it can take up to 24 hours. Don't panic if GitHub's DNS check still shows an error an hour after saving. Check your propagation status at dnschecker.org.

Step 3: Verify DNS & Enforce HTTPS on GitHub

Return to the GitHub Pages tab (Settings > Pages) and click Refresh periodically until you see the DNS check pass.

  1. Once DNS has propagated, GitHub will show a green checkmark and the message "DNS check successful" next to your custom domain.
  2. Immediately below the domain input, you'll see a checkbox labeled Enforce HTTPS. It may be greyed out for a few minutes while GitHub provisions your free TLS certificate via Let's Encrypt. Wait until it becomes clickable.
  3. Check the Enforce HTTPS box. This permanently redirects all HTTP requests to HTTPS and activates the padlock icon in visitors' browsers. Never skip this step — HTTP sites are flagged as "Not Secure" by Chrome and Firefox.
  4. Wait 2–5 minutes for the certificate to provision. Then visit https://yourdomain.com in a new tab. You should see your site, served securely.

Verify via Command Line (Optional but Satisfying)

Open your terminal and run these commands to confirm DNS is resolving correctly:

dig yourdomain.com +noall +answer
# Should return the 4 GitHub IPs (185.199.x.153)

dig www.yourdomain.com +noall +answer
# Should return a CNAME pointing to yourusername.github.io

Step 4: Protect Your Domain with GitHub's Domain Verification

This optional but highly recommended step prevents another GitHub user from claiming your custom domain on their repository while your DNS records are active. Without verification, a bad actor could briefly hijack traffic to your domain by pointing it at their Pages site.

  1. Go to GitHub Settings (your profile icon → Settings) → PagesAdd a domain.
  2. Enter your custom domain and click Add domain. GitHub will provide you a unique TXT record value.
  3. Go back to Porkbun DNS Management. Add a new TXT record: Host = _github-pages-challenge-yourusername, Answer = the value GitHub gave you.
  4. Return to GitHub and click Verify. Once verified, your domain shows a purple badge — it is now exclusively linked to your account.

Troubleshooting Common Issues

If something isn't working, run down this checklist before spending an hour searching Stack Overflow.

Pro Tips: Getting the Most Out of This Stack

The Real Cost Breakdown

Let's be precise about what you're actually paying — and what you're not.

SERVICE THIS STACK TYPICAL ALTERNATIVE Domain name (.com) ~$8/year (Porkbun) $15–$20/year (GoDaddy) Web hosting $0.00 (GitHub Pages) $50–$200/year SSL / HTTPS certificate $0.00 (Let's Encrypt) $0–$100/year CDN / Global delivery $0.00 (GitHub CDN) $20–$100/year TOTAL ANNUAL COST ~$8/year $85–$320+/year

Conclusion: Why This Changes Everything

For independent developers, freelance designers, small businesses, nonprofits, or open-source projects, the Porkbun + GitHub Pages combination is a genuine architectural game-changer. You bypass restrictive storage limits, bandwidth throttling, and the upsell banners endemic to "free" hosting tiers. You get a setup with better uptime, faster global delivery, and more deployment flexibility than most paid shared hosting plans.

The total technical investment is: 10–15 minutes of your time, five DNS records, and one annual domain renewal. In return, you get an enterprise-grade web presence with a custom domain, HTTPS, a global CDN, version-controlled deployments, and automatic CI/CD — for the price of a couple of cups of coffee per year.

#Porkbun #GitHubPages #ZeroCostHosting #DNSConfiguration #WebArchitecture #Tutorial #FrontendDevelopment #StaticHosting #CustomDomain #HTTPS

References & Official Documentation

Ref 1

GitHub. Configuring a custom domain for your GitHub Pages site. Official documentation covering DNS record setup, custom domain verification, and HTTPS enforcement. Available at docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site.

Ref 2

GitHub. Managing a custom domain for your GitHub Pages site — Apex domain configuration. Specifies the four required A record IPs (185.199.108–111.153) for root domain pointing and explains why four are required for GitHub's redundant infrastructure.

Ref 3

Porkbun. Official DNS Help Documentation and Knowledge Base. Explains how Porkbun's DNS interface works, including how empty Host fields map to the root domain (@), and how to manage record types. Available at kb.porkbun.com.

Ref 4

Let's Encrypt. How It Works. Background on the free, automated certificate authority that powers HTTPS enforcement on GitHub Pages. Understanding this helps when troubleshooting certificate provisioning delays. Available at letsencrypt.org/how-it-works.

Share this insight