And then come the "hard way"....
This information comes from the "info" utility (info hostname) while logged into a terminal as super user:
The commands are:
hostname - show or set the system's host name
domainname - show or set the system's NIS/YP domain name
SYNOPSIS
hostname [-v] [-a] [--alias] [-d] [--domain] [-f] [--fqdn] [-i] [--ip-address] [--long] [-s] [--short] [-y] [--yp] [--nis] [-n] [--node]
hostname [-v] [-F filename] [--file filename] [hostname]
domainname [-v] [-F filename] [--file filename] [name]
When called without any arguments, these program displays the current names. Only the super user can set the values.
The host name is usually set once at system startup in /etc/rc.d/rc.inet1 or /etc/init.d/boot (normally by reading the contents of a file which contains the host name, e.g. /etc/hostname).
THE FQDN
You can't change the FQDN (Fully Qualified Domain Name as returned by hostname --fqdn). The FQDN of the system is the name that the resolver returns for the host name.
Technically: The FQDN is the name gethostbyname returns for the host name returned by gethostname. The DNS domain name is the part after the first dot.
Therefore it depends on the configuration (usually in /etc/host.conf) how you can change it. Usually (if the hosts file is parsed before DNS or NIS) you can change it in /etc/hosts.
|