localhost name resolution problem

W. Sierke ws at senet.com.au
Mon Mar 31 12:36:32 PST 2003


Hi,

In the course of trying to resolve a problem with sendmail (refusing to
deliver even local mail), I saw a note in the sendmail configuration docs
which says "host localhost must resolve to 127.0.0.1". However, when I
checked my system I instead found (details obscured):

# host localhost
localhost.my.domain is a nickname for my.domain
my.domain has address 202.x.x.x


Someone suggested I check localhost.:

# host localhost.
Host not found.


I'm not (wasn't) running a nameserver, my host.conf contains the entries
hosts and bind in that order, resolv.conf has a single, automatic (from
PPPoE)
nameserver entry which works, hostname is set to this_machine.my.domain.

hosts contains
::1 localhost.my.domain localhost
127.0.0.1 localhost.my.domain localhost
192.168.100.1 this_machine.my.domain this_machine
192.168.100.2 another_machine.my.domain another_machine
...


The domain I'm using is one serviced by dyndns.org, and I have a dynamic IP
address. I've now installed bind and have got to the point where localhost
again resolves to 127.0.0.1 (and sendmail appears to be happy again).
Notably in the process of doing this I've changed my domain name from
"something.fictitious" to "my.domain". Now, however, (in part):

# host -v localhost
Trying domain "my.domain"
rcode = 3 (Non-existent domain), ancount=0
Trying domain "domain"
rcode = 0 (Success), ancount=1
The following answer is not authoritative:
The following answer is not verified as authentic by the server:
localhost.domain     66929 IN        A       127.0.0.1

# host -v localhost.
rcode = 3 (Non-existent domain), ancount=0
Host not found.


Even though I've overcome my initial problem, I'm not happy and rather feel
as though I've begun creating a monster (and that's the last thing I wanted
to be doing when moving to FreeBSD). For example, I feel somewhat
uncomfortable that localhost is now resolving from "domain" instead of
"my.domain". I'm also confused about how I should be configuring bind when
dyndns.org handles the dns for my domain (and whether I should really be
running it at all). But I've exhausted my pitiful knowledge and searching
capabilities for the moment. The handbook doesn't appear to be complete
(following its example doesn't appear to help with the localhost resolution
issue) and all of the material I've trawled up from the 'net is either too
hard to follow or too old.


Thanks,

Wayne



More information about the freebsd-questions mailing list