NNicheStackTutorials
← All tutorials
Static Hosting

Free Custom Domain for Static Sites Without Paying for Email Hosting

Connected Cloudflare domain to free Pages hosting. DNS-only setup, www redirect, and avoiding registrar upsells.

·10 min read·Static Hosting
Free Custom Domain for Static Sites Without Paying for Email Hosting cover

Goal: myblog.dev on Cloudflare Pages — $0 hosting, ~$12/yr domain only Trap avoided: Registrar "free hosting" bundle that injects ads

Architecture

Registrar (Porkbun/Namecheap) → nameservers → Cloudflare DNS → Pages project

Don't point A record to random free host IPs — use proper static host.

Step 1: Domain on Cloudflare

Add site to Cloudflare (free plan). Update nameservers at registrar.

Step 2: Cloudflare Pages custom domain

Pages → project → Custom domains → add myblog.dev and www.myblog.dev

CF auto-creates DNS records:

CNAME myblog.dev → myproject.pages.dev (flattened)
CNAME www → myproject.pages.dev

www → apex redirect

Cloudflare Rules → Redirect rule:

If hostname equals www.myblog.dev
Then redirect to https://myblog.dev${uri.path} (301)

Or handle in Pages _redirects:

https://www.myblog.dev/* https://myblog.dev/:splat 301

Free alternatives compared

HostCustom domain free?
Cloudflare PagesYes
Vercel HobbyYes
Netlify FreeYes
GitHub PagesYes
Surge.shYes (CLI)

All work. Pick based on bandwidth/build needs (see comparison article).

Email without paying for hosting

Use Cloudflare Email Routing (free) → forward to Gmail:

hello@myblog.dev → mypersonal@gmail.com

No mailbox hosting needed for a static blog.

SSL

Cloudflare Universal SSL covers apex + www. Full (strict) mode once Pages cert active.

Verify

dig myblog.dev +short
curl -I https://myblog.dev
# 200, strict-transport-security if enabled

Total cost: domain registration only. No hosting invoice.

Registrar gotchas

  • Parking page enabled by default on some registrars — disable before DNS change
  • WHOIS privacy — optional, unrelated to hosting
  • Auto-renew — set calendar reminder anyway

Subdomain for staging

dev.myblog.dev → CNAME → dev-branch.pages.dev

Free second hostname on same Pages project — test before swapping production DNS.

Transfer vs nameserver-only

You don't need to transfer domain to Cloudflare to use Pages — just point nameservers. Keep registrar you trust.

Tags: DomainCloudflareFree HostingDNS