[geeks] DNS issue, localhost not resolving properly

Charles Shannon Hendrix shannon at widomaker.com
Tue Dec 12 14:58:22 CST 2006


Mon, 11 Dec 2006 @ 23:03 -0500, Ian Viemeister said:

> On Mon, 11 Dec 2006, Charles Shannon Hendrix wrote:
> 
> > I thought localhost was supposed to automatically resolve as long as
> > it was in the local zone files
> 
> "localhost." will resolve properly if you have a localhost.zone or
> equivalent file sey up (as in the example you posted).

Well... since I have that, I'd like to know why it doesn't work now.

It did in BIND v8.

I read through notes about v8 versus v9, and I didn't see anything
related to this that I should change.

> > and the local zone files listed the hostmasters FQDN in them.
> 
> I'm not quite sure what you mean there...

Nothing as it turns out. I was trying to figure out why Bind v8 knew how
to resolve localhost.goid.lan, and v9 doesn't.

> > 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.
> 
> As in "host localhost" returned "192.168.1.2"?  That's -- broken.

Yes it is, so is my memory and finger control.

I should have said it returned a 127 address.  Sorry.

> > What I did today was add this:
> >
> > localhost IN CNAME escape.goid.lan.
> >
> > ...to my zone file for the LAN's domain.
> 
> That's probably *not* what you want to do.

No, it isn't, but it made sendmail work until I can figure out the real
problem.

> If you have an entry for "localhost.goid.lan.", it should really have a
> "A 127.0.0.1" record to avoid... odd problems with other machines on the
> network thinking "localhost" is remote, etc.

Is that considered the proper thing to do? Have any query to
localhost.<localdomain> return 127.0.0.1? Makes sense I guess.

Of course if that works, I'll be left wondering why I never had to have
it before.

Not that I have time for that really.

> Um.  *Which* RFC says to configure sendmail to talk to
> "localhost.your.domain.here"?  

I wasn't intending to suggest any RFC did that.

I thought you were questioning why sendmail would do a DNS query on the
submit host, whatever that happens to be.

> And *that* would be the actual problem.  Use "localhost." (with the dot),
> or "[127.0.0.1]", or "escape.goid.lan.".  In your case, I'd recommend
> using "[127.0.0.1]", as mentioned near the bottom of
> <http://www.sendmail.org/m4/features.html>.

It's currently using localhost with a dot. Always has been as far back
as I can remember.

A lot of sendmail maintainers and admins believe that using [127.0.0.1]
is a hack to get around a DNS problem.

I'm not that pedantic myself.

> Put FEATURE(`msp', `[127.0.0.1]')dnl in whichever .mc file you are using
> to generate submit.cf
> 
> > 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.
> 
> Hopefully the NetBSD docs have gotten better since then ;-)

No, it still says pretty much the same thing.  The example for a dynamic
IP setup, for example, is the same as it has been for a very long time.

The NetBSD documentation is generally pretty good, but poorly indexed,
and tends to leave out non-mainstream, non-ideal situations.  That's 
pretty common in the UNIX world really.

For example, UNIX really doesn't like non-ideal network setups, most OS
don't, so things like dynamic WAN connections are always a PITA.

The documementation is 99.9% covering static IPs and systems with DNS
and other services.

Those of us with hybrid setups have little documentation to go on.

Of course, that's one reason I wish someone would just sell a cheap pipe
and quit helping me to death...

> Seriously, email has changed just a *little* bit in 12 years, and
> sendmail's behavior has changed along with it. Twelve years ago -- none of
> us would have seen the point in a "spam filter".  Ten years ago, filtering
> 205.199.212.0/24 and a few others was enough.  Since then...
> 
> Er... sorry about the rant, I got off on a tangent there.  My point was
> that you probably want to review sendmail configs more than once a decade ;-)

Nothing wrong with ranting, and I *do* revisit the configuration.

It's just that my situation really hasn't changed, so there hasn't been
much to change.  I do change slightly every 2 years or so, but nothing
in the basic configuration, just adding things, or handling slight
alterations in the local network.

Most of that is external to sendmail too.

Most of the changes I make to sendmail are limited to the ugly hacks
needed to make dynamic WAN connections function alongside private LANs,
like adding user address exceptions, etc.




-- 
shannon "AT" widomaker.com -- ["We have nothing to prove" -- Alan Dawkins]



More information about the geeks mailing list