[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: where is /etc/hosts supposed to come from?



On Tue, Dec 29, 2009 at 08:46:09AM +0100, Vincent Bernat wrote:

> And BTW, this is exactly what hostname -f does. It does not read /etc/hostname.

Nothing should read /etc/hostname except /etc/init.d/hostname.sh during
boot. Everything else should use either uname(2) or gethostname(3)
(which in turn calls uname() internally).

For example, on NFSROOT setups /etc/hostname usually does not exist
to prevent the host name received from DHCP being overwritten.

Gabor

-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------


Reply to: