version 1, including all changes.
.
| Rev |
Author |
# |
Line |
| 1 |
perry |
1 |
HOSTNAME |
| |
|
2 |
!!!HOSTNAME |
| |
|
3 |
NAME |
| |
|
4 |
SYNOPSIS |
| |
|
5 |
DESCRIPTION |
| |
|
6 |
OPTIONS |
| |
|
7 |
FILES |
| |
|
8 |
AUTHORS |
| |
|
9 |
---- |
| |
|
10 |
!!NAME |
| |
|
11 |
|
| |
|
12 |
|
| |
|
13 |
hostname - show or set the system's host name |
| |
|
14 |
dnsdomainname - show the system's DNS domain name |
| |
|
15 |
!!SYNOPSIS |
| |
|
16 |
|
| |
|
17 |
|
| |
|
18 |
__hostname__ [[__-v__] [[__-a__] [[__--alias__] |
| |
|
19 |
[[__-d__] [[__--domain__] [[__-f__] [[__--fqdn__] |
| |
|
20 |
[[__-i__] [[__--ip-address__] [[__--long__] |
| |
|
21 |
[[__-s__] [[__--short__] [[__-y__] [[__--yp__] |
| |
|
22 |
[[__--nis__] |
| |
|
23 |
|
| |
|
24 |
|
| |
|
25 |
__hostname__ [[__-v__] [[__-F filename__] [[__--file |
| |
|
26 |
filename__] [[__hostname__] |
| |
|
27 |
|
| |
|
28 |
|
| |
|
29 |
__hostname__ [[__-v__] [[__-h__] [[__--help__] |
| |
|
30 |
[[__-V__] [[__--version__] |
| |
|
31 |
|
| |
|
32 |
|
| |
|
33 |
__dnsdomainname__ [[__-v__] |
| |
|
34 |
!!DESCRIPTION |
| |
|
35 |
|
| |
|
36 |
|
| |
|
37 |
__Hostname__ is used to either set or display the current |
| |
|
38 |
host or domain name of the system. This name is used by many |
| |
|
39 |
of the networking programs to identify the machine. The |
| |
|
40 |
domain name is also used by NIS/YP. |
| |
|
41 |
|
| |
|
42 |
|
| |
|
43 |
__GET NAME__ |
| |
|
44 |
|
| |
|
45 |
|
| |
|
46 |
When called without any arguments, the program displays the |
| |
|
47 |
current names: |
| |
|
48 |
|
| |
|
49 |
|
| |
|
50 |
__hostname__ will print the name of the system as |
| |
|
51 |
returned by the gethostname(2) function. |
| |
|
52 |
|
| |
|
53 |
|
| |
|
54 |
__dnsdomainname__ will print the domain part of the FQDN |
| |
|
55 |
(Fully Qualified Domain Name). The complete FQDN of the |
| |
|
56 |
system is returned with __hostname --fqdn__. |
| |
|
57 |
|
| |
|
58 |
|
| |
|
59 |
__SET NAME__ |
| |
|
60 |
|
| |
|
61 |
|
| |
|
62 |
When called with one argument or with the __--file__ |
| |
|
63 |
option, the commands set the host name or the NIS/YP domain |
| |
|
64 |
name. |
| |
|
65 |
|
| |
|
66 |
|
| |
|
67 |
Note, that only the super-user can change the |
| |
|
68 |
names. |
| |
|
69 |
|
| |
|
70 |
|
| |
|
71 |
It is not possible to set the FQDN or the DNS domain name |
| |
|
72 |
with the __dnsdomainname__ command (see __THE FQDN__ |
| |
|
73 |
below). |
| |
|
74 |
|
| |
|
75 |
|
| |
|
76 |
The host name is usually set once at system startup in |
| |
|
77 |
''/etc/rc.d/rc.inet1'' or ''/etc/init.d/boot'' |
| |
|
78 |
(normally by reading the contents of a file which contains |
| |
|
79 |
the host name, e.g. ''/etc/hostname''). |
| |
|
80 |
|
| |
|
81 |
|
| |
|
82 |
__THE FQDN__ |
| |
|
83 |
|
| |
|
84 |
|
| |
|
85 |
You can't change the FQDN (as returned by __hostname |
| |
|
86 |
--fqdn__) or the DNS domain name (as returned by |
| |
|
87 |
__dnsdomainname__) with this command. The FQDN of the |
| |
|
88 |
system is the name that the resolver(3) returns for |
| |
|
89 |
the host name. |
| |
|
90 |
|
| |
|
91 |
|
| |
|
92 |
Technically: The FQDN is the name gethostbyname(2) |
| |
|
93 |
returns for the host name returned by gethostname(2). |
| |
|
94 |
The DNS domain name is the part after the first |
| |
|
95 |
dot. |
| |
|
96 |
|
| |
|
97 |
|
| |
|
98 |
Therefore it depends on the configuration (usually in |
| |
|
99 |
''/etc/host.conf'') how you can change it. Usually (if |
| |
|
100 |
the hosts file is parsed before DNS or NIS) you can change |
| |
|
101 |
it in ''/etc/hosts''. |
| |
|
102 |
!!OPTIONS |
| |
|
103 |
|
| |
|
104 |
|
| |
|
105 |
''-a, --alias'' |
| |
|
106 |
|
| |
|
107 |
|
| |
|
108 |
Display the alias name of the host (if used). |
| |
|
109 |
|
| |
|
110 |
|
| |
|
111 |
''-d, --domain'' |
| |
|
112 |
|
| |
|
113 |
|
| |
|
114 |
Display the name of the DNS domain. Don't use the command |
| |
|
115 |
__domainname__ to get the DNS domain name because it will |
| |
|
116 |
show the NIS domain name and not the DNS domain name. Use |
| |
|
117 |
__dnsdomainname__ instead. |
| |
|
118 |
|
| |
|
119 |
|
| |
|
120 |
''-F, --file filename'' |
| |
|
121 |
|
| |
|
122 |
|
| |
|
123 |
Read the host name from the specified file. Comments (lines |
| |
|
124 |
starting with a `#') are ignored. |
| |
|
125 |
|
| |
|
126 |
|
| |
|
127 |
''-f, --fqdn, --long'' |
| |
|
128 |
|
| |
|
129 |
|
| |
|
130 |
Display the FQDN (Fully Qualified Domain Name). A FQDN |
| |
|
131 |
consists of a short host name and the DNS domain name. |
| |
|
132 |
Unless you are using bind or NIS for host lookups you can |
| |
|
133 |
change the FQDN and the DNS domain name (which is part of |
| |
|
134 |
the FQDN) in the ''/etc/hosts'' file. |
| |
|
135 |
|
| |
|
136 |
|
| |
|
137 |
''-h, --help'' |
| |
|
138 |
|
| |
|
139 |
|
| |
|
140 |
Print a usage message and exit. |
| |
|
141 |
|
| |
|
142 |
|
| |
|
143 |
''-i, --ip-address'' |
| |
|
144 |
|
| |
|
145 |
|
| |
|
146 |
Display the IP address(es) of the host. |
| |
|
147 |
|
| |
|
148 |
|
| |
|
149 |
''-s, --short'' |
| |
|
150 |
|
| |
|
151 |
|
| |
|
152 |
Display the short host name. This is the host name cut at |
| |
|
153 |
the first dot. |
| |
|
154 |
|
| |
|
155 |
|
| |
|
156 |
''-V, --version'' |
| |
|
157 |
|
| |
|
158 |
|
| |
|
159 |
Print version information on standard output and exit |
| |
|
160 |
successfully. |
| |
|
161 |
|
| |
|
162 |
|
| |
|
163 |
''-v, --verbose'' |
| |
|
164 |
|
| |
|
165 |
|
| |
|
166 |
Be verbose and tell what's going on. |
| |
|
167 |
|
| |
|
168 |
|
| |
|
169 |
''-y, --yp, --nis'' |
| |
|
170 |
|
| |
|
171 |
|
| |
|
172 |
Display the NIS domain name. If a parameter is given (or |
| |
|
173 |
__--file name__ ) then root can also set a new NIS |
| |
|
174 |
domain. |
| |
|
175 |
!!FILES |
| |
|
176 |
|
| |
|
177 |
|
| |
|
178 |
__/etc/hosts__ |
| |
|
179 |
!!AUTHORS |
| |
|
180 |
|
| |
|
181 |
|
| |
|
182 |
Peter Tobias, |
| |
|
183 |
Bernd Eckenfels, |
| |
|
184 |
---- |