Changeset 82d2dbe for chapter07/network.xml
- Timestamp:
- 05/19/2016 06:45:27 AM (7 years ago)
- Branches:
- systemd
- Children:
- 33d5aa3
- Parents:
- 60962be
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/network.xml
r60962be r82d2dbe 198 198 <secondary>/etc/hosts</secondary> 199 199 </indexterm> 200 201 <para>Decide on the IP address, fully-qualified domain name (FQDN), and 202 possible aliases for use in the <filename>/etc/hosts</filename> file. The 203 syntax is:</para> 204 200 201 <para>Decide on a fully-qualified domain name (FQDN), and possible aliases 202 for use in the <filename>/etc/hosts</filename> file. If using static 203 addresses, you'll also need to decide on an IP address. The syntax 204 for a hosts file entry is:</para> 205 205 206 <screen><literal>IP_address myhost.example.org aliases</literal></screen> 206 207 … … 217 218 <para>x can be any number in the range 16-31. y can be any number in the 218 219 range 0-255.</para> 219 220 220 221 <para>A valid private IP address could be 192.168.1.1. A valid FQDN for 221 222 this IP could be lfs.example.org.</para> 222 223 223 224 <para>Even if not using a network card, a valid FQDN is still required. 224 225 This is necessary for certain programs to operate correctly.</para> 225 226 <para>Create the <filename>/etc/hosts</filename> file by running:</para> 226 227 <para>If using DHCP, DHCPv6, IPv6 Autoconfiguration, or if a network card 228 is not going to be configured, create the <filename>/etc/hosts</filename> 229 file by running the following command:</para> 227 230 228 231 <screen><userinput>cat > /etc/hosts << "EOF" 229 <literal># Begin /etc/hosts (network card version) 232 <literal># Begin /etc/hosts 233 234 127.0.0.1 <replaceable><HOSTNAME.example.org></replaceable> <replaceable><HOSTNAME></replaceable> localhost <replaceable>[alias1] [alias2] ...</replaceable> 235 ::1 <replaceable><HOSTNAME.example.org></replaceable> <replaceable><HOSTNAME></replaceable> localhost <replaceable>[alias1] [alias2] ...</replaceable> 236 237 # End /etc/hosts</literal> 238 EOF</userinput></screen> 239 240 <para>The ::1 entry is the IPv6 counterpart of 127.0.0.1 and represents 241 the IPv6 loopback interface.</para> 242 243 <para>If ussing a staic address, create the <filename>/etc/hosts</filename> 244 file by running this command instead:</para> 245 246 <screen role="nodump"><userinput>cat > /etc/hosts << "EOF" 247 <literal># Begin /etc/hosts 230 248 231 249 127.0.0.1 localhost 232 250 ::1 localhost 233 <replaceable><192.168.0.2></replaceable> <replaceable><HOSTNAME.example.org></replaceable> <replaceable>[alias1] [alias2] ...</replaceable> 234 235 # End /etc/hosts (network card version)</literal> 236 EOF</userinput></screen> 237 238 <para>The <replaceable><192.168.0.2></replaceable> and 239 <replaceable><HOSTNAME.example.org></replaceable> values need to be 251 <replaceable><192.168.0.2></replaceable> <replaceable><HOSTNAME.example.org></replaceable> <replaceable><HOSTNAME></replaceable> <replaceable>[alias1] [alias2] ...</replaceable> 252 253 # End /etc/hosts</literal> 254 EOF</userinput></screen> 255 256 <para>The <replaceable><192.168.0.2></replaceable>, 257 <replaceable><HOSTNAME.example.org></replaceable>, and 258 <replaceable><HOSTNAME></replaceable> values need to be 240 259 changed for specific uses or requirements (if assigned an IP address by a 241 260 network/system administrator and the machine will be connected to an 242 261 existing network). The optional alias name(s) can be omitted.</para> 243 262 244 <para>If a network card is not going to be configured, create the245 <filename>/etc/hosts</filename> file by running:</para>246 247 <screen role="nodump"><userinput>cat > /etc/hosts << "EOF"248 <literal># Begin /etc/hosts (no network card version)249 250 127.0.0.1 <replaceable><HOSTNAME.example.org></replaceable> <replaceable><HOSTNAME></replaceable> localhost251 ::1 localhost252 253 # End /etc/hosts (no network card version)</literal>254 EOF</userinput></screen>255 256 <para>The ::1 entry is the IPv6 counterpart of 127.0.0.1 and represents the IPv6 loopback interface.</para>257 258 263 </sect2> 259 264
Note:
See TracChangeset
for help on using the changeset viewer.