Hello Sergey, > Matias A. Fonzo <s...@dragora.org> 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