1 .TH HOSTNAME 1 "28 Jan 1996" "net-tools" "Linux Programmer's Manual"
4 hostname \- show or set the system's host name
6 domainname \- show or set the system's NIS/YP domain name
8 dnsdomainname \- show the system's DNS domain name
10 nisdomainname \- show or set system's NIS/YP domain name
12 ypdomainname \- show or set the system's NIS/YP domain name
14 nodename \- show or set the system's DECnet node name
26 .RB [ \-\-ip-address ]
40 .RB [ \-\-file\ filename ]
47 .RB [ \-\-file\ filename ]
54 .RB [ \-\-file\ filename ]
77 is the program that is used to either set or display
78 the current host, domain or node name of the system. These names are used
79 by many of the networking programs to identify the machine. The domain
80 name is also used by NIS/YP.
83 When called without any arguments, the program displays the current
88 will print the name of the system as returned by the
93 .B "domainname, nisdomainname, ypdomainname"
94 will print the name of the system as returned by the
96 function. This is also known as the YP/NIS domain name of the system.
100 will print the DECnet node name of the system as returned by the
106 will print the domain part of the FQDN (Fully Qualified Domain Name). The
107 complete FQDN of the system is returned with
108 .BR "hostname \-\-fqdn" .
111 When called with one argument or with the
113 option, the commands set the host name, the NIS/YP domain name or
117 Note, that only the super-user can change the names.
120 It is not possible to set the FQDN or the DNS domain name with the
127 The host name is usually set once at system startup in
128 .I /etc/rc.d/rc.inet1
131 (normally by reading the contents of a file which contains
136 You can't change the FQDN (as returned by
137 .BR "hostname \-\-fqdn" )
138 or the DNS domain name (as returned by
139 .BR "dnsdomainname" )
140 with this command. The FQDN of the system is the name that the
142 returns for the host name.
145 Technically: The FQDN is the name
146 .BR gethostbyname (2)
147 returns for the host name returned by
149 The DNS domain name is the part after the first dot.
151 Therefore it depends on the configuration (usually in
153 how you can change it. Usually (if the hosts file is parsed before DNS or
154 NIS) you can change it in
161 Display the alias name of the host (if used).
164 Display the name of the DNS domain. Don't use the command
166 to get the DNS domain name because it will show the NIS domain name and
167 not the DNS domain name. Use
171 .I "\-F, \-\-file filename"
172 Read the host name from the specified file. Comments (lines starting with
175 .I "\-f, \-\-fqdn, \-\-long"
176 Display the FQDN (Fully Qualified Domain Name). A FQDN consists of a
177 short host name and the DNS domain name. Unless you are using bind or NIS
178 for host lookups you can change the FQDN and the DNS domain name (which is
179 part of the FQDN) in the \fI/etc/hosts\fR file.
182 Print a usage message and exit.
184 .I "\-i, \-\-ip-address"
185 Display the IP address(es) of the host.
188 Display the DECnet node name. If a parameter is given (or
190 ) the root can also set a new node name.
193 Display the short host name. This is the host name cut at the first dot.
195 .I "\-V, \-\-version"
196 Print version information on standard output and exit successfully.
198 .I "\-v, \-\-verbose"
199 Be verbose and tell what's going on.
201 .I "\-y, \-\-yp, \-\-nis"
202 Display the NIS domain name. If a parameter is given (or
204 ) then root can also set a new NIS domain.
208 Peter Tobias, <tobias@et-inf.fho-emden.de>
210 Bernd Eckenfels, <net-tools@lina.inka.de> (NIS and manpage).
212 Steve Whitehouse, <SteveW@ACM.org> (DECnet support and manpage).