NAME (name)
Host Name Displays or sets the system - hostname
DOMAINNAME - NIS display or set the system's / YP domain name
dnsdomainname - show the system's DNS domain name
nisdomainname - NIS display or set the system's / YP domain name
ypdomainname - NIS display or set the system's / YP domain name
nodename - DECnet node name or display system is provided
SYNOPSIS (Overview)
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]
nodename [-v] [-F filename] [--file filename] [name]
hostname [-v] [-h] [--help] [-V] [--version]
dnsdomainname [ -v ]
nisdomainname [ -v ]
ypdomainname [ -v ]
DESCRIPTION (description)
Hostname is a program used to set or display the current host node name, domain or system. These names are used in many networking program to identify the machine .NIS / YP domain name is also used.
GET NAME (get the name)
If you do not call any arguments, the program displays the current names:
hostname name will printing system through the gethostname (2) function returns the value.
domainname, nisdomainname, ypdomainname will print the name of the system through getdomainname (2) function returns a value. It also is seen as the system YP / NIS domain name.
the nodename DECnet node named by the printing system getNodeName (2) function returns the value.
dnsdomainname will print the domain part of the FQDN (Fully Qualified Domain Name) The complete FQDN of the system can use the hostname --fqdn return.
SET NAME (set name)
If a parameter with a belt or --file option is invoked, then the command that is to set the host name, NIS / YP domain name or the node name.
Note that only the super user can modify these names.
Impossible to use dnsdomainname command (see below THE FQDN) to the DNS domain name, or FQDN provided.
Every time the system starts, the host name is usually /etc/rc.d/rc.inet1 or /etc/init.d/boot (typically by reading the contents of the file, including a host name, e.g., / etc / hostname ) in settings.
THE FQDN
You can not use this command to modify the FQDN (by --fqdn hostname return) or the DNS domain name (by dnsdomainname return). FQDN is a system of the Resolver (3) returns the host name.
Technically: FQDN refers to the use gethostbyname (2) to return to the gethostname (2) the name of the host name of the DNS domain name is the return part after the first dot.
So it depends on the configuration of your modifications (usually /etc/host.conf ) is typically (if the hosts file is parsed before DNS or NIS) you can. / Etc / hosts modification.
OPTIONS (option)
- -a, - alias
- Alias show host (if used words).
- -d,--domain
- Display DNS. Do not use the command domainname to get the DNS domain name because it will show the NIS domain name instead of the DNS domain name. May be used dnsdomainname replace it.
- -F,--file filename
- Reads the host name from the specified file. Comment (to 'lines beginning with a `#) can be ignored.
- -f,--fqdn,--long
- Display FQDN (Fully Qualified Domain Name). A FQDN includes a short format of the host name and the DNS domain name. Unless you are using bind or NIS to make the host asks, or you can / etc / hosts modify FQDN and the DNS domain file (this is the FQDN a part of).
- -h,--help
- Print usage information and exit.
- -i,--ip-address
- Displaying the IP address of a host (group).
- -n,--node
- Display DECnet node name. If parameters are specified (or specified --file name ), then root can also set a new node name.
- -s,--short
- Short display format hostname. It is a first host name is removed behind the dot portion.
- -V,--version
- Print version information on standard output and exit with a successful status.
- -v,--verbose
- And inform the detailed explanation is doing.
- -y, - yp, - nis
- Display the NIS domain name. If parameters are specified (or specified --file name ), then root can also set a new NIS domain.