*BSD News Article 72277


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.mel.connect.com.au!news.mira.net.au!vic.news.telstra.net!act.news.telstra.net!psgrain!charnel.ecst.csuchico.edu!olivea!sgigate.sgi.com!swrinde!cssun.mathcs.emory.edu!gatech!news.mathworks.com!fu-berlin.de!cs.tu-berlin.de!uni-erlangen.de!news.tu-chemnitz.de!irz401!orion.sax.de!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Host name
Date: 27 Jun 1996 20:51:32 GMT
Organization: Private BSD site, Dresden
Lines: 34
Message-ID: <4qus8k$9p@uriah.heep.sax.de>
References: <4qfhju$bi5@uwm.edu> <4qk7ki$9hc@uriah.heep.sax.de>
  <4qql67$10c@anorak.coverform.lan>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.6
X-Phone: +49-351-2012 669
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E

brian@awfulhak.demon.co.uk (Brian Somers) wrote:

> : > I'm having trouble with my host name accepted by the system.  At boot
> : > time, I get a "BAD VALUE" message, and the mail daemon gives the
> : > message "My host name (myname.my.domain) doesn't seem to exist"

> : 127.0.0.1	localhost.	myname.my.domain.
> 
> : (Note the trailing dots.)
> 
> You don't need the trailing dots - not in /etc/hosts.

You need'em. :-)

Apparently, sendmail, Apache etc. do call

	gethostbyname("myname.my.domain.");

The trailing dot forces a shortcut into the root domain, bypassing all
domain search order walkdown when using DNS.  However, when not using
DNS, a simple lookup in /etc/hosts is done, and if that name is not
found there, ``"myname.my.domain" does not exist''.

It's arguable whether this is a bug in the resolver library, but until
it has been fixed, adding the dot in /etc/hosts is a suitable
workaround.  HOWEVER: you need both entries there, with and without
the dot!

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)