Locahl
Buy Locahl
TLDlocal developmenthosts file.testDNS

Which TLD to Use for Local Development (.test vs .localhost)

Which TLD to use for local development: prefer .test, avoid .dev and .local. Why .test is reserved, how to map it in the hosts file, and HTTPS tips.

L

Locahl Team

Β·2 min read

Use `.test` for local development. It is officially reserved by the IETF (RFC 6761) for testing, so it will never become a real public domain and cannot collide with a live site. Avoid .dev (a real Google-owned TLD that forces HTTPS) and .local (reserved for mDNS/Bonjour). The other safe reserved options are .localhost and .example.

Best TLDs for local development

TLDStatusUse for local dev?
.testReserved (RFC 6761)Yes β€” recommended
.localhostReserved (RFC 6761)Yes
.exampleReserved (RFC 6761)Yes (less common)
.devReal TLD, HSTS-preloadedNo β€” forces HTTPS
.localmDNS/BonjourNo β€” resolution conflicts
.appReal TLD, HSTS-preloadedNo

Why .test wins

.test is guaranteed never to resolve on the public internet, so myapp.test always means "my local project." There is no risk that a colleague's typo leaks to a real site, and no browser HTTPS coercion.

Why avoid .dev and .app

Both are real TLDs on the HSTS preload list. Browsers force HTTPS on them, so a plain HTTP dev server at myapp.dev fails to load. If you need HTTPS locally, set it up deliberately with mkcert β€” see local HTTPS with mkcert.

Why avoid .local

.local is reserved for multicast DNS (Bonjour/Avahi). Using it for hosts entries causes slow lookups, intermittent failures, and conflicts with device discovery.

How to set up a .test domain

Add it to the hosts file and flush DNS:

TEXT
127.0.0.1 myapp.test api.myapp.test

See the hosts file syntax guide and, when done, flush DNS. For many dynamic subdomains (*.myapp.test), the hosts file cannot use wildcards β€” use dnsmasq, covered in wildcard local domains with dnsmasq.

Manage them without editing files by hand

Juggling several .test domains across projects gets messy fast. Locahl stores each mapping with a one-click toggle and flushes DNS automatically, so switching between projects is instant.

_Last reviewed: June 2026._

Also readhosts file syntax and format guide
Also readWildcard local domains with dnsmasq
Share this article
Available on Windows, macOS & Linux

Ready to simplify your workflow?

Stop wasting time with the terminal. Locahl lets you manage your hosts file in a few clicks, with automatic validation and no risk of errors.

  • Intuitive visual interface
  • Automatic DNS flush
  • Multi-environment management
  • Automatic backups
  • JSON Import/Export
Buy Locahl β€” $5.99One-time payment, no subscription

Reader Reviews

4.7β˜…(3 reviews)
Aaron M.
β˜…β˜…β˜…β˜…β˜…

"Switched all my projects from .dev to .test after reading this. No more forced-HTTPS surprises."

June 12, 2026

Petra V.
β˜…β˜…β˜…β˜…β˜…

"Clear reasoning on why .local breaks with mDNS. Exactly the explanation I needed."

June 10, 2026

Sam K.
β˜…β˜…β˜…β˜…β˜…

"Great guidance. A wildcard subdomain example would be the cherry on top."

June 8, 2026

Frequently Asked Questions

What TLD should I use for local development?

Use .test. It is reserved by the IETF (RFC 6761) for testing and will never be a real public TLD, so it cannot clash with a live domain.

Why should I avoid .dev for local development?

.dev is a real public TLD owned by Google and is on the HSTS preload list, forcing HTTPS in browsers. That breaks plain HTTP local sites.

Is .local safe for local development?

No. .local is reserved for mDNS/Bonjour and can cause slow or failed resolution and conflicts on many systems.

How do I map a .test domain?

Add a line to the hosts file: 127.0.0.1 myapp.test, then flush DNS. For many subdomains, use dnsmasq with a wildcard.

Related Articles

2 min read
WordPresslocal developmenthosts file

WordPress Local Development With a .test Domain (hosts file)

Set up a local WordPress site with a clean .test domain using the hosts file. Works with LocalWP, MAMP, XAMPP and Docker. Map the domain, flush DNS, configure WP.

L

Locahl Team

Developer tools team

6 min read
DNSmacOS Tahoeflush DNS

macOS Tahoe Flush DNS Cache Command

Clear DNS cache on macOS Tahoe 26 with the exact Terminal command, verification steps, browser cache checks and hosts file troubleshooting.

L

Locahl Team

Developer tools team

6 min read
hosts fileDNSlocal development

Hosts File: Location, Syntax and Uses (2026)

Learn what the hosts file does, where to find it on Mac, Windows and Linux, syntax examples, local dev uses and mistakes to avoid.

L

Locahl Team

2 min read
DNSLinuxflush DNS

Flush DNS on Linux: systemd-resolved & more (2026)

Flush the DNS cache on Linux with resolvectl flush-caches (systemd-resolved), plus nscd, dnsmasq and BIND. Commands by setup, with verification steps.

L

Locahl Team

Developer tools team