DevOps

How to get a working domain without buying one (5 methods)

nip.io, sslip.io, hosts file, dnsmasq, Cloudflare Tunnel — every free way to have a working hostname for local dev.

You need a hostname for local dev. Ingress rules require one. A real domain costs roughly ₹500-1,500/year depending on TLD and registrar. Here are 5 free methods that work today.

Method 1 — nip.io / sslip.io (public magic DNS)

Free public DNS service that resolves any hostname of the pattern:

<anything>.<ip-with-dashes>.nip.io

If your minikube IP is 192.168.49.2:

  • myapp.192-168-49-2.nip.io → resolves to 192.168.49.2
  • dashboard.192-168-49-2.nip.io → same
  • db.192-168-49-2.nip.io → same

Zero setup. Works from any machine. No signup, no config.

Use in Ingress:

- host: hello.192-168-49-2.nip.io

sslip.io = identical mirror service. Interchangeable.

Method 2 — Local hosts file (works offline)

Only YOUR machine sees the domain.

Windows: C:\Windows\System32\drivers\etc\hosts (needs admin) Mac/Linux: /etc/hosts (needs sudo)

Add:

192.168.49.2   myapp.local
127.0.0.1      dashboard.local

Browser now resolves myapp.local to 192.168.49.2.

  • Pro: offline, permanent, personal
  • Con: only you see it. GitHub webhooks can’t reach it.

Method 3 — dnsmasq (custom domain for whole machine)

For a real-looking custom domain across your machine, without editing hosts per-app.

Install:

brew install dnsmasq        # Mac
sudo apt install dnsmasq    # Linux

Config (Mac path):

address=/.mycompany.test/192.168.49.2

Restart dnsmasq. Now anything.mycompany.test resolves to 192.168.49.2 automatically.

  • Pro: clean hostnames like argocd.mycompany.test
  • Con: setup complexity, only your machine

Method 4 — Cloudflare Tunnel (real HTTPS public URL)

Turns a random-name.trycloudflare.com URL into a public HTTPS tunnel to your local service.

Install:

brew install cloudflared        # Mac
winget install Cloudflare.cloudflared    # Windows

Run:

cloudflared tunnel --url http://localhost:80

Prints URL like https://random-name-1234.trycloudflare.com. Real internet-reachable.

  • Pro: real HTTPS, GitHub webhooks work
  • Con: URL changes on restart with the default --url mode. For stable hostnames, use a named Cloudflare Tunnel — included FREE in Cloudflare Zero Trust (up to ~50 seats), requires only a domain added to Cloudflare with its nameservers.

Method 5 — ngrok

Same idea as Cloudflare Tunnel.

ngrok http 80

Prints https://xxxx.ngrok-free.app URL.

  • Pro: works instantly
  • Con: needs ngrok account signup, URL changes on restart

Which method for which use case

Use caseMethod
Just see it in your browsernip.io or hosts file
Other people (same wifi) should see itnip.io
Real HTTPS for external testingCloudflare Tunnel
GitHub webhook back to your local machineCloudflare Tunnel or ngrok
Custom domain names, multi-app devdnsmasq
Something you’ll re-use for yearsBuy a real domain

Local-only trick — localtest.me

*.localtest.me always resolves to 127.0.0.1. Similar to nip.io but hardcoded to localhost.

Ingress:

- host: hello.localtest.me

Browser: http://hello.localtest.me → hits 127.0.0.1.

The subtle gotcha nobody mentions

Your Ingress ADDRESS matters more than the hostname. Check:

kubectl get ingress

Look at ADDRESS column:

  • 192.168.49.2 → use myapp.192-168-49-2.nip.io
  • 127.0.0.1 → use myapp.127-0-0-1.nip.io

Hostname must resolve to whatever IP your Ingress is exposed on. Otherwise browser can’t reach it even though the ingress is technically working.

When you SHOULD buy a real domain

For production. Users need to bookmark and trust the URL. Cloudflare / Namecheap / Porkbun sell for ₹500-1,500/year.

Then point DNS A record at your cluster’s LoadBalancer IP → cert-manager gets a real TLS cert → users hit myapp.yourcompany.com.

The Ingress YAML doesn’t change. Only the host: string does.

TL;DR

  • Local dev: nip.io or hosts file — free, instant
  • External test/webhooks: Cloudflare Tunnel — free, real HTTPS
  • Production: buy a real domain — roughly ₹500-1,500/year depending on TLD + registrar

Never buy a domain for local dev experiments. Everything above is free.

Skip the boilerplate

DevOps YAML Pack

40+ production-ready configs — Kubernetes, Docker, Terraform, Ansible, Helm, GitHub Actions. Every file commented. Copy, edit two lines, ship. MIT license, no watermarks.

Get the pack — ₹499 →