From The Linux Programming Interface
struct utsname { char sysname[_UTSNAME_LENGTH]; /* Implementation name */ char nodename[_UTSNAME_LENGTH]; /* Node name on network */ char release[_UTSNAME_LENGTH]; /* Implementation release level */ char version[_UTSNAME_LENGTH]; /* Release version level */ char machine[_UTSNAME_LENGTH]; /* Hardware on which system is running */ #ifdef _GNU_SOURCE /* Following is Linux-specific */ char domainname[_UTSNAME_LENGTH]; /* NIS domain name of host */ #endif };
The
nodename
field returns the value that was set using thesethostname()
system call (see the manual page for details of this system call). Often, this name is something like the hostname prefix from the system’s DNS domain name.The
domainname
field returns the value that was set using thesetdomainname()
system call (see the manual page for details of this system call). This is the Network Information Services (NIS) domain name of the host (which is not the same thing as the host’s DNS domain name).
Is nodename
used by some DNS server for resolving the hostname of the current machine to its IP address? If yes, which DNS server is that?
Does sethostname()
send a new value of nodename
from the local machine to the DNS server to update the hostname in the DNS record for the local machine?
Similar questions for domainname
and setdomainname()
, if possible.