little formatting fix
[oss-qm-packages.git] / man / en_US / hostname.1
blobcea3f6e34bf5627f618acef48b2a205219abaae6
1 .TH HOSTNAME 1 "28 Jan 1996" "net-tools" "Linux Programmer's Manual"
3 .SH NAME
4 hostname \- show or set the system's host name
5 .br
6 domainname \- show or set the system's NIS/YP domain name
7 .br
8 dnsdomainname \- show the system's DNS domain name
9 .br
10 nisdomainname \- show or set system's NIS/YP domain name
11 .br
12 ypdomainname \- show or set the system's NIS/YP domain name
13 .br
14 nodename \- show or set the system's DECnet node name
16 .SH SYNOPSIS
17 .B hostname
18 .RB [ \-v ]
19 .RB [ \-a ]
20 .RB [ \-\-alias ]
21 .RB [ \-d ]
22 .RB [ \-\-domain ]
23 .RB [ \-f ]
24 .RB [ \-\-fqdn ]
25 .RB [ \-i ]
26 .RB [ \-\-ip-address ]
27 .RB [ \-\-long ]
28 .RB [ \-s ]
29 .RB [ \-\-short ]
30 .RB [ \-y ]
31 .RB [ \-\-yp ]
32 .RB [ \-\-nis ]
33 .RB [ \-n ]
34 .RB [ \-\-node ]
36 .PP
37 .B hostname 
38 .RB [ \-v ]
39 .RB [ \-F\ filename ]
40 .RB [ \-\-file\ filename ]
41 .RB [ hostname ]
43 .PP
44 .B domainname
45 .RB [ \-v ]
46 .RB [ \-F\ filename ]
47 .RB [ \-\-file\ filename ]
48 .RB [ name ]
50 .PP 
51 .B nodename
52 .RB [ \-v ]
53 .RB [ \-F\ filename ]
54 .RB [ \-\-file\ filename ]
55 .RB [ name ]
57 .PP
58 .B hostname
59 .RB [ \-v ]
60 .RB [ \-h ]
61 .RB [ \-\-help ]
62 .RB [ \-V ]
63 .RB [ \-\-version ]
65 .PP
66 .B dnsdomainname
67 .RB [ \-v ]
68 .br
69 .B nisdomainname
70 .RB [ \-v ]
71 .br
72 .B ypdomainname
73 .RB [ \-v ]
75 .SH DESCRIPTION
76 .B Hostname
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.
82 .SS "GET NAME"
83 When called without any arguments, the program displays the current
84 names:
86 .LP
87 .B hostname
88 will print the name of the system as returned by the
89 .BR gethostname (2)
90 function.
92 .LP
93 .B "domainname, nisdomainname, ypdomainname"
94 will print the name of the system as returned by the
95 .BR getdomainname (2)
96 function. This is also known as the YP/NIS domain name of the system.
98 .LP
99 .B nodename
100 will print the DECnet node name of the system as returned by the
101 .BR getnodename (2)
102 function.
105 .B dnsdomainname
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" .
110 .SS "SET NAME"
111 When called with one argument or with the 
112 .B \-\-file
113 option, the commands set the host name, the NIS/YP domain name or
114 the node name. 
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 
121 .B dnsdomainname 
122 command (see 
123 .B "THE FQDN"
124 below).
127 The host name is usually set once at system startup in
128 .I /etc/rc.d/rc.inet1
130 .I /etc/init.d/boot
131 (normally by reading the contents of a file which contains
132 the host name, e.g. 
133 .IR /etc/hostname ).
135 .SS THE FQDN
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
141 .BR resolver (3)
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
148 .BR gethostname (2).
149 The DNS domain name is the part after the first dot.
151 Therefore it depends on the configuration (usually in 
152 .IR /etc/host.conf )
153 how you can change it. Usually (if the hosts file is parsed before DNS or 
154 NIS) you can change it in 
155 .IR /etc/hosts .
158 .SH OPTIONS
160 .I "\-a, \-\-alias"
161 Display the alias name of the host (if used).
163 .I "\-d, \-\-domain"
164 Display the name of the DNS domain. Don't use the command
165 .B domainname
166 to get the DNS domain name because it will show the NIS domain name and
167 not the DNS domain name. Use
168 .B dnsdomainname 
169 instead.
171 .I "\-F, \-\-file filename"
172 Read the host name from the specified file. Comments (lines starting with
173 a `#') are ignored.
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.
181 .I "\-h, \-\-help"
182 Print a usage message and exit.
184 .I "\-i, \-\-ip-address"
185 Display the IP address(es) of the host.
187 .I "\-n, \-\-node"
188 Display the DECnet node name. If a parameter is given (or
189 .B \-\-file name
190 ) the root can also set a new node name.
192 .I "\-s, \-\-short"
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 
203 .B \-\-file name
204 ) then root can also set a new NIS domain.
205 .SH FILES
206 .B /etc/hosts
207 .SH AUTHOR
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).