Skip to main content

06. Connecting a Custom Domain

1. Overview​

Purchased securenomad.kr from Gabia (a Korean domain registrar) and connected the subdomain wiki.securenomad.kr to the GitHub Pages site.

Visitor ─▶ wiki.securenomad.kr
│ (Gabia DNS: CNAME)
▼
inseokjeon-sec.github.io (GitHub Pages)
│
▼
Deployed output (build) of the SecureNomad repository
ItemBeforeAfter
Site URLhttps://inseokjeon-sec.github.io/SecureNomad/https://wiki.securenomad.kr
baseUrl/SecureNomad//
HTTPSGitHub default certificateCertificate issued automatically by GitHub (Let's Encrypt)

2. Choosing the connection method​

DNS instead of forwarding​

MethodBehaviorResult
URL redirect (forwarding)Redirects my domain to the github.io URLThe address bar changes to github.io
URL masking (frame)Shows the site inside an iframe on my domainHTTPS issues, poor search visibility, fixed URL while navigating
DNS (CNAME)My domain points directly to GitHub Pages serversSite served on my domain, free HTTPS

→ Chose DNS, the method officially supported by GitHub Pages.

Subdomain​

TypeExampleRecords needed
Subdomain (chosen)wiki.securenomad.kr1 CNAME
Apex domainsecurenomad.kr4 A records (+ www CNAME)
  • Simpler to configure
  • The apex domain stays available for other uses such as a main homepage

3. Buying the domain (Gabia)​

ItemSettingReason
WHOIS privacyOnHides name, address, and contact details
Auto-renewalOnExpiration would take the site down and let others register the domain
Hosting, forwarding, email add-onsNot usedGitHub Pages provides hosting and HTTPS for free
Name serversKeep Gabia defaults (ns.gabia.co.kr)Only a few records are needed, so no separate DNS is required

:::tip Check the renewal price Check the renewal price from year 2 onward, not just the first-year discount. :::

4. Verifying domain ownership on GitHub (TXT)​

Why it matters​

:::danger Subdomain Takeover If the CNAME record remains in DNS after GitHub Pages is disconnected, someone else can register the same domain on their own GitHub Pages repository and serve arbitrary content on my subdomain. Verifying the domain on my GitHub account ensures that only repositories in my account can use it. :::

Steps​

  1. Top-right profile picture → Settings (account settings) on GitHub
  2. Left menu Pages → Add a domain
  3. Enter the apex domain securenomad.kr (verify the apex domain even when using a subdomain)
  4. Add the TXT record that GitHub provides to Gabia DNS
TypeHostValue
TXT_github-pages-challenge-<username>Verification value issued by GitHub
  1. Click Verify on GitHub → confirm Verified
caution

The verification value is issued per account, so it is not published in documents or screenshots.

5. Adding a CNAME record in Gabia DNS​

My Gabia → Domains → manage securenomad.kr → DNS management tool

The DNS management screen:

SectionUsed
DNS settings → [Edit records]Yes (add TXT and CNAME)
Domain connectionNo (for Gabia hosting)
ForwardingNo (redirect / masking)
Web parking / Mobile parkingNo

Add the record​

  1. Click [Edit records] next to DNS settings
  2. Click [Add record] → fill in a new row
  3. Click the row's [OK] → [Save] at the bottom
TypeHostValueTTL
TXT_github-pages-challenge-<username>(verification value)600
CNAMEwikiinseokjeon-sec.github.io.600
  • Enter only wiki as the host (Gabia appends .securenomad.kr automatically)
  • Do not add a path such as /SecureNomad to the value
  • The trailing dot (.) marks the end of the domain. Remove it and retry if you get a format error
  • Keep the existing TXT record

6. Checking DNS propagation​

nslookup wiki.securenomad.kr

Example of a correct result:

Name: inseokjeon-sec.github.io
Addresses: 185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
Aliases: wiki.securenomad.kr
  • If Aliases shows my domain and Name shows the github.io address, the CNAME is active
  • Propagation can take from a few minutes to a few hours

7. Updating project files​

static/CNAME (new)​

A file without an extension containing a single line with the domain.

static/CNAME
wiki.securenomad.kr

Files in static/ are copied to the root of build/ → deployed as build/CNAME so GitHub Pages recognizes the domain.

docusaurus.config.js​

docusaurus.config.js
url: 'https://wiki.securenomad.kr',
baseUrl: '/',
FieldReason for change
urlCanonical site URL (used for the sitemap, share links, etc.)
baseUrlServed from the domain root, so /SecureNomad/ → /

:::warning If baseUrl is not changed CSS and JS files are requested from /SecureNomad/..., and the page renders broken. :::

Apply​

Check for errors with npm run build, then Commit → Push origin in GitHub Desktop.

8. Repository Pages settings​

Repository SecureNomad → top Settings → left Pages

  1. Under Build and deployment, enter wiki.securenomad.kr in Custom domain → Save
  2. Confirm DNS check successful
  3. Check Enforce HTTPS

:::info Enforce HTTPS is disabled The checkbox stays grayed out until the certificate is issued. Check it once it becomes available (a few minutes to up to a day). :::

9. Points that were confusing​

There are two Settings pages​

LocationPurpose
Profile picture → Settings → Pages (account)Domain ownership verification (TXT, Verify)
Repository → Settings → Pages (repository)Custom domain, Enforce HTTPS

Order of work​

① Buy the domain
② Verify the domain in account Settings (TXT)
③ Add the CNAME in Gabia
④ Confirm propagation with nslookup
⑤ Update CNAME file + config → Push
⑥ Save Custom domain in repository Settings → Enforce HTTPS

:::caution Why the order matters If ⑤ and ⑥ are done before DNS propagates (④), the github.io URL redirects to a domain that is not connected yet, and the site becomes temporarily unreachable. :::

10. Result​

  • Site URL: https://wiki.securenomad.kr
  • https://inseokjeon-sec.github.io/SecureNomad/ redirects to the new domain automatically
  • HTTPS enabled (padlock icon)

Checklist​

  • Account Settings → Pages: securenomad.kr Verified
  • Gabia DNS: TXT and CNAME (wiki) records registered
  • nslookup shows github.io
  • static/CNAME, url, baseUrl updated and pushed
  • Repository Settings → Pages: DNS check successful
  • Enforce HTTPS checked
  • https://wiki.securenomad.kr reachable