bug-inetutils
[Top][All Lists]
Advanced

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

Re: [bug-inetutils] hostname -d: domainname


From: Sergey Poznyakoff
Subject: Re: [bug-inetutils] hostname -d: domainname
Date: Sat, 24 Jul 2010 10:58:20 +0300

Matias A. Fonzo <address@hidden> ha escrit:

> The question is: `hostname' does not pickup the domainname even if we are
> set from /etc/sysctl.conf?

Hostname obtains data using the gethostname(2) call.  The
/etc/sysctl.conf file is used at startup to set kernel parameters via
sysctl(8).  The gethostname function does not necessarily use kernel tables.
In particular, in glibc implementation, it effectively ignores them,
so that the domain returned by `hostname' does not necessarily coincide
with the one set by the kernel.domainname parameter.

Technically speaking, in glibc, gethostname is a wrapper over uname(2)
call, which returns the `nodename' member of the returned struct utsname.

Regards,
Sergey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]