DNS records / Local domains
How to create local DNS records for development
A local DNS zone lets you model production-like DNS records for development without publishing anything to public DNS.
When this is useful
Local DNS records are useful when a project needs stable names instead of raw IP addresses. They make local environments easier to read, easier to share, and closer to production, especially when different components expect different hostnames.
Use local records for web apps, API gateways, mail-related tests, service discovery, reverse DNS checks, wildcard tenant names, or any workflow where a realistic DNS response is better than a single hosts-file entry.
Start with a zone
Create a zone such as project.local, internal.test, or a private domain that your team controls. Records inside the zone can use short names such as @, api, or www.
@ A 127.0.0.10
api A 127.0.0.11
www CNAME @
txt TXT local verification text
Useful record types
- A / AAAA: map names to IPv4 or IPv6 addresses.
- CNAME: create an alias to another host.
- TXT: store text values used by tools and verification flows.
- MX: describe the mail exchanger for a domain.
- SRV: describe a service endpoint such as
_sip._tcp. - PTR: map an IP address back to a name in a reverse zone.
- CAA: describe which certificate authorities may issue certificates.
Wildcard records
Wildcard records make generated subdomains easier to test.
* A 127.0.0.50
*.wild A 127.0.0.99
* matches any direct name under the zone. *.wild matches direct names under wild.project.local.