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.
displays the alias name of the host (if used).
displays the name of the DNS domain.
reads the host name from the specified file. Comments (lines starting with a #) are ignored.
displays the FQDN (Fully Qualified Domain Name).
displays the IP address(es) of the host.
displays the short host name. This is the host name cut at the first dot.
prints version information on standard output and exits successfully.
tells what's going on.
displays the NIS domain name. If a parameter is given (or --file name) then root can also set a new NIS domain.