hostname [-v] [-a] [--alias] [-d] [--domain] [-f] [--fqdn] [-i] [--ip-address] [--long] [-s] [--short] [-y] [--yp] [--nis] hostname [-v] [-F filename] [--file filename] [hostname] hostname [-v] [-h] [--help] [-V] [--version] |
Hostname is used to either set or display the current host or domain name of the system. This name is used by many of the networking programs to identify the machine. The domain name is also used by NIS/YP.
When called without any arguments, the program displays the name of the system as returned by the gethostname(2) function.
When called with one argument or with the --file option, the commands set the host name or the NIS/YP domain name. Note, that only the super-user can change the names.
Display the alias name of the host (if used).
Display the name of the DNS domain.
Read the host name from the specified file. Comments (lines starting with a #) are ignored.
Display the FQDN (Fully Qualified Domain Name).
Display the IP address(es) of the host.
Display the short host name. This is the host name cut at the first dot.
Print version information on standard output and exit successfully.
Be verbose and tell what's going on.
Display the NIS domain name. If a parameter is given (or --file name) then root can also set a new NIS domain.