"localhost" zone: what should we do?

Barry Margolin barmar at alum.mit.edu
Tue Mar 15 13:50:20 UTC 2005

In article <d16i4d$10md$1 at sf1.isc.org>,
 Mariano Cunietti <mcunietti at enter.it> wrote:

> Hi all,
> we have some problems with a PHP function (ftp_connect), which requires
> a hostname as an argument. This function looks up our DNS for an address
> resolution of "localhost", instead of using his own localhost. We
> checked out /etc/nsswitch.con file and everything looks OK.
> We need to know which is the *best practice* about creating "localhost"
> entries in a named.conf and in a zone file. We already have a 127.
> inverse zone, but we never created a "localhost" zone and file.
> Should we configure a localhost A record per zone (localhost IN A
> or a root localhost zone?
> Everything ran smoothly until today (since 1998).

The most common practice is to create a localhost.<domain> record in 
your default domain.  Since systems are usually configured to append the 
local domain to any name that doesn't contain any dots, this allows the 
name to be resolved in one query instead of two.

Barry Margolin, barmar at alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

More information about the bind-users mailing list