Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.mel.connect.com.au!news.uwa.edu.au!disco.iinet.net.au!news.uoregon.edu!arclight.uoregon.edu!news.sprintlink.net!news-stk-200.sprintlink.net!news.sprintlink.net!news-stk-11.sprintlink.net!news.mathworks.com!newsfeed.internetmci.com!hunter.premier.net!netnews.worldnet.att.net!ix.netcom.com!netcom.net.uk!dispatch.news.demon.net!demon!awfulhak.demon.co.uk!awfulhak.demon.co.uk!awfulhak.demon.co.uk!not-for-mail From: brian@awfulhak.demon.co.uk (Brian Somers) Newsgroups: comp.unix.bsd.freebsd.misc Subject: Re: Host name Date: 30 Jun 1996 00:40:59 -0500 Organization: Coverform Ltd. Lines: 53 Message-ID: <4r541b$167@anorak.coverform.lan> References: <4qfhju$bi5@uwm.edu> <4qk7ki$9hc@uriah.heep.sax.de> <4qus8k$9p@uriah.heep.sax.de> NNTP-Posting-Host: localhost.coverform.lan X-NNTP-Posting-Host: awfulhak.demon.co.uk X-Newsreader: TIN [version 1.2 PL2] J Wunsch (j@uriah.heep.sax.de) wrote: : 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."); [stuff deleted] : 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! Hmmm, in that case, sendmail, Apache etc. are wrong IMO. They don't really have the right to dodge your resolv.conf search list or domain "climb". They are trying to avoid the overheads that result from a mis-design. What's really needed is a gethostbyabsolutename() function. What's also needed is a struct hostent *gethostfortarget( struct hostent * ) that'll return the host that I should say I am when talking to the supplied host. This way things like X can pass a correct DISPLAY value to other machines - those other machines will have a reasonable chance of talking back. Currently, the only way to address the above problem properly is to declare a loop device per interface in your kernel config, ifconfig these interfaces with each of your "real interface" IPs (and a netmask of 0xffffffff), and make damn sure that all machines that you can talk to can route to your "true" ip number. What I'm really saying is that having ONE hostname is wrong. You have many host names (one per interface) plus localhost. I think that the hostname program should either be removed or be made to print host names for all interfaces. gethostname() and sethostname() should both be removed. -- Brian <brian@awfulhak.demon.co.uk> Don't _EVER_ lose your sense of humour....