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

Re: Showstopping bug: gethostname() behaving incorrectly



> According to info docs and precedent, it should return a FQDN.  All
> other systems, including other Linux systems, behave this way.  The
> libc info docs say it should behave this way.  But it does not.

Not quite sure which info docs you are refering to, but....

Many other linux distros put the FQDN in /etc/hostname. Debian doesn't do
that. As the man page points out, gethostname behaves like uname -n, which
in turn just reads the value set by hostname.

There has been some debate about whether the fqdn should go into
/etc/hostname; however, if programs need to get a fqdn, the correct way to
do it seems to be to first do a gethostname() call followed by a
gethostbyname() call to retrieve the real FQDN. That's how "hostname -f"
works iirc.

randolph
-- 
Debian Developer <tausq@debian.org>
http://www.TauSq.org/


Reply to: