Zone File - 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 @ 1D IN AAAA ::1

The corresponding reverse zone definition is:

;; reverse zone file for 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 "" IN { type master; file "r.local"; }; zone "" 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

Other articles related to "localhost":


In computer networking, localhost (meaning this computer) is the standard hostname given to the address of the loopback network interface. Simply put, when a user sends data to localhost, they will receive their own data. This mechanism is useful for programmers to test their software during development. The name is also a reserved top-level domain name (cf. .localhost), set aside to avoid confusion with the narrower definition as a hostname.

On modern computer systems, localhost as a hostname translates to an IPv4 address in the (loopback) net block, usually, or ::1 in IPv6. Localhost is specified where one would otherwise use the hostname of a computer. For example, directing a web browser installed on a system running an HTTP server to http://localhost will display the home page of the web site installed on that system, provided the server is configured to service the loopback interface. Using the loopback interface also bypasses local network interface hardware. Connecting to locally hosted network services such as a computer game server using loopback addresses puts less of a load on network resources.

The Internet Engineering Task Force (IETF) Internet Standard document STD-2 series (e.g., RFC 1700) reserved the address block for loopback purposes. until such definitions were updated exclusively through the Internet Assigned Numbers Authority (IANA) website. A later IETF document, Special-Use IPv4 Addresses (RFC 3330) describes the usage of the IPv4 address block for loopback purposes. It is therefore excluded from assignment by a Regional Internet Registry or IANA. Lastly, RFC 3330 has been superseded by the newer RFC 5735.

For IPv4 communications, the virtual loopback interface of a computer system is normally assigned the address with subnet mask Depending on the specific operating system in use (notably in Linux and Microsoft Windows) and the routing mechanisms installed, this populates the routing table of the local system with an entry so that packets destined to any address from the block would be routed internally to the network loopback device.

In IPv6, on the other hand, the loopback routing prefix ::1/128 consists of only one address ::1 (0:0:0:0:0:0:0:1 in full notation, the address with a one at its least significant bit and zero otherwise) is explicitly defined as the loopback address, though additional addresses may be assigned as needed to the loopback interface by the host administrator.

Any IP datagram with a source or destination address set to a loopback address must not appear outside of a computing system, or be routed by any routing device. Packets received on an interface with a loopback destination address must be dropped.

One notable exception to the use of the 127/8 network addresses is their use in Multiprotocol Label Switching (MPLS) traceroute error detection techniques (RFC 4379) in which their property of not being routable provides a convenient means to avoid delivery of faulty packets to end users.