[svlug] fetchmail

Dagmar d'Surreal dagmar at dsurreal.org
Mon Jun 4 19:53:04 PDT 2001


On Mon, 4 Jun 2001, David E. Fox wrote:

> > Odds are nameservice for localhost is not working.  Check /etc/hosts
> > and /etc/nsswitch.conf (make sure filed is early in the resolve order).
> 
> I thought localhost was always synonymous with 127.0.0.1, by definition,
> regardless of its presence (or absence) in /etc/hosts. I realize it's
> a good thing to include 127.0.0.1 / localhost in /etc/hosts, but I
> would think the translation would be unnecessary, and no name service
> would need to exist. (Aside: the IP infrastructure always returns
> 127.0.0.1 for bogus sites such as "ftp.warez.org" ; where is this done? Is
> there really a 'nameservice' as such for the special address 127.0.0.1, in
> other words? I note that I did not put in the alias in /etc/hosts for
> ftp.warez.org.)

Well, we can make the definition in the usual way (/etc/hosts) or we can
add all kindsa happy kludges to the system resolver to make it
permanent.  Personally, I'd rather not implement kludges anymore often
than I absolutely have to.

Using 127.0.0.1 as a polite way of saying "No we don't do that here" is
pretty common actually, since it's always a giggle to give people a
hostname that resolves to that as an FTP server.  There are occasionally
newbies around who will actually try exploits against such hosts and
succeed.  :)  It's also fun to encourage these people to trash the sites
once they break in.  =)  All you have to do is define the host with that
IP in your zone files.  I think I've personally got both warez and pr0n
listed in my zone files, as well as
"you.have.found.the.pretty.princess" and some other throwbacks from when I
would leave my zone files open for people to download at will.

About the only thing further worth mentioning about 127.0.0.1 is that it
is often useful to put a 0.0.127.in-addr.arpa zone into nameservers where
you one might use nslookup from the machine itself.  If 127.0.0.1 is
listed as your resolver in your /etc/resolv.conf, nslookup will pitch a
fit and error out if it can't look up the name of the resolver it's
querying (i.e., 127.0.0.1).  With that and a localhost entry in your
primary zone you can get around problems with some broken resolver
libraries common to non-Unix operating systems.  ;)





More information about the svlug mailing list