domainname & hostname

file: /proc/sys/kernel/domainname & hostname
variable: kernel.domainname & hostname
Official reference

These files can be used to set the NIS/YP domainname and the hostname of your box in exactly the same way as the commands domainname and hostname, i.e.:

# echo "darkstar" > /proc/sys/kernel/hostname
# echo "mydomain" > /proc/sys/kernel/domainname

has the same effect as

# hostname "darkstar"
# domainname "mydomain"

Note, however, that the classic has the hostname “darkstar” and DNS (Internet Domain Name Server) domainname “”, not to be confused with the NIS (Network Information Service) or YP (Yellow Pages) domainname. These two domain names are in general different. For a detailed discussion see the hostname(1) man page.