Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: Hostname questions
- To: tlug@example.com
- Subject: Re: Hostname questions
- From: Thomas O'Dowd <tom@example.com>
- Date: Tue, 17 Jul 2001 15:24:12 +0900
- Content-Disposition: inline
- Content-Type: text/plain; charset=us-ascii
- Delivered-To: tlug@example.com
- In-Reply-To: <F184g3Sv0YKpDS7hx270001bcb0@example.com>; from jean_christian@example.com on Tue, Jul 17, 2001 at 03:39:01AM -0000
- List-Help: <mailto:tlug-request@example.comsubject=help>
- List-Post: <mailto:tlug@example.com>
- List-Subscribe: <mailto:tlug-request@example.comsubject=subscribe>
- List-Unsubscribe: <mailto:tlug-request@example.comsubject=unsubscribe>
- Old-Return-Path: <tom@example.com>
- References: <F184g3Sv0YKpDS7hx270001bcb0@example.com>
- Reply-To: tlug@example.com
- Resent-From: tlug@example.com
- Resent-Message-ID: <9V7OkC.A.iRB.5r9U7@example.com>
- Resent-Sender: tlug-request@example.com
- Sender: Thomas O'Dowd <tom@example.com>
- User-Agent: Mutt/1.2.5i
On Tue, Jul 17, 2001 at 03:39:01AM -0000, Jean-Christian Imbeault wrote: > >Did you reboot? It is written by the startup scripts. > >I think it is only there for informational purposes, though, > >so you are not in trouble if it's not there. > > Yes, I did reboot. It's still empty. Glad to know it's not really needed. > But then that begs the question . . . why is it there at all? Probably you put it there at some stage :) It is not used on 7.1 > >Some do, but that's not really proper. They should get it by > >calling /bin/hostname or something like calling gethostbyaddr(3) > >on their own socket. > > That's what I've been waiting for someone to say!! So now I know that > /etc/hosts doesn't need and shouldn't need an entry for my machine. > > But I have to put as a hack against bad-mannered apps :) Hang on a minute... The machine name and ip address *should* be put in /etc/hosts, if you want your machine to work correctly. This is not because of bad-mannered apps (who would be crazy to parse /etc/hosts themselves) but because, if DNS drops off the face of the earth, your machine still needs to be able to resolve its hostname/address. Forget about it finding it in /etc/sysconfig/network, it just reads that at the start to know how to set networking up... The machine on the kernel and driver level is happy from the setup. The problem is where applications need to know how names map to ip addresses and vice-versa. They make standard library calls to functions like gethostbyaddr() to resolve names/addresses as they go a long, this library is responsible for resolving these and it uses either hosts.conf or nsswitch.conf to find out what databases to use to resolve hosts with. This means it will probably look at the /etc/hosts "database" first and then DNS. If your machine name/ip is in /etc/hosts all will be fine even if DNS is down. If it is not there, the library is not going to be able to find it and apache mightn't start and sendmail mightn't start and a whole host of other things mightn't start... The moral of the story is, put it in /etc/hosts and /etc/sysconfig/network not for no reason nor a bad reason but because that's how it is... Tom. -- Thomas O'Dowd. - Nooping - http://nooper.com tom@example.com - Testing - http://nooper.co.jp/labs
- Follow-Ups:
- Re: Hostname questions
- From: Tobias Diedrich <ranma@example.com>
- References:
- Re: Hostname questions
- From: "Jean-Christian Imbeault" <jean_christian@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: Hostname questions
- Next by Date: Re: Hostname questions
- Prev by thread: Re: Hostname questions
- Next by thread: Re: Hostname questions
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links