Zone File - Localhost

Localhost

Some server software automatically configures resource records for specially recognized domains or hostnames, such as localhost, but a customized zone master file may be used.

An example for manual configuration of the forward zone for localhost is the following:

$ORIGIN localhost. @ 1D IN SOA @ root 1999010100 3h 15m 1w 1d @ 1D IN NS @ @ 1D IN A 127.0.0.1 @ 1D IN AAAA ::1

The corresponding reverse zone definition is:

;; reverse zone file for 127.0.0.1 and ::1 ;; don't put $ORIGIN in here $TTL 3W @ 3W IN SOA localhost. root.localhost. 1999010100 3h 15m 1w 1d @ 3W IN NS localhost. 1 3W IN PTR localhost.

This file does not specify the origin so that it may be used for both IPv4 and IPv6 with this configuration:

zone "0.0.127.in-addr.arpa" IN { type master; file "r.local"; }; zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { type master; file "r.local"; };

Similar zone master files may be created for the reverse resolution of the broadcast address and the null address. Such zone files prevent a DNS server to refer to other possibly external DNS servers.

Read more about this topic:  Zone File