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: Matias A. Fonzo
Subject: Re: [bug-inetutils] hostname -d: domainname
Date: Sat, 24 Jul 2010 17:49:03 -0300 (ART)
User-agent: SquirrelMail/1.4.15

Hello Sergey,

> 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.
>

What about getdomainname(2)?

Thanks,
Matías







reply via email to

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