[geeks] DNS issue, localhost not resolving properly

Charles Shannon Hendrix shannon at widomaker.com
Mon Dec 11 20:01:53 CST 2006


Mon, 11 Dec 2006 @ 19:43 -0500, Ian Viemeister said:

> On Mon, 11 Dec 2006, Charles Shannon Hendrix wrote:
> 
> > I have a problem with localhost.<my domain> not resolving in BIND 9.
> 
> Ok... but unless I missed something there, the zone files you showed were
> for "localhost.", not "goid.lan.", which would contain "localhost.goid.lan."
> 
> > Everything works, except that sendmail sometimes panics, unable to find
> > localhost.goid.lan (goid.lan is my local private LAN).
> 
> Do you have an entry for "localhost" in goid.lan.zone?

I thought localhost was supposed to automatically resolve as long as
it was in the local zone files and the local zone files listed the
hostmasters FQDN in them.

When I ran Bind v8, a query on localhost returned the LAN IP address
when run on the DNS server and MX lookup worked too.

When I moved to Bind v9, localhost resolved to 127.0.0.1 and
localhost.goid.lan didn't resolve at all.

What I did today was add this:

localhost IN CNAME escape.goid.lan.

...to my zone file for the LAN's domain.

% nslookup localhost
Server:         192.168.1.2
Address:        192.168.1.2#53

% nslookup localhost.goid.lan
Server:		192.168.1.2
Address:	192.168.1.2#53

localhost.goid.lan	canonical name = escape.goid.lan.
Name:	escape.goid.lan
Address: 192.168.1.2

localhost.goid.lan      canonical name = escape.goid.lan.
Name:   escape.goid.lan
Address: 192.168.1.2

So... sendmail is happy again.

However, now my LAN thinks there is a host called localhost.goid.lan,
which isn't really true, and I wonder what else this will trip up.

Or is it normal for the zone master of a domain to also be considered
"localhost" for the domain?

> (A better question might be why sendmail is *looking* for localhost.goid.lan
>  in the first place, but without knowing how the rest of the network is
>  setup...)

The short answer is that the RFC says so. That's also the long answer I
got many years ago on the sendmail forums.

My LAN has a machine called escape.goid.lan, which does email, DNS,
news, and routing for the rest of the LAN. It has an ISP connection
through a modem which is used for email and news.

localhost is configured as the MTAHost in the submit.cf file, which is
generated by my machine's m4 input files. The local domain's MX host is
mail.goid.lan.

It's set up that way because the NetBSD documentation said to do it that
way, and its been that way for about 12 years now.

Doesn't mean it isn't wrong, just that I have no idea why.



-- 
shannon "AT" widomaker.com -- [4649 5920 4320 204e 4452 5420 5348 5920 4820
2056 2054 434d 2048 4d54 2045 204e 5259 4820 444e 0a53]



More information about the geeks mailing list