|
@@ -197,11 +197,12 @@ EOF</userinput></screen>
|
|
|
<primary sortas="d-network">network</primary>
|
|
|
<secondary>/etc/hosts</secondary>
|
|
|
</indexterm>
|
|
|
-
|
|
|
- <para>Decide on the IP address, fully-qualified domain name (FQDN), and
|
|
|
- possible aliases for use in the <filename>/etc/hosts</filename> file. The
|
|
|
- syntax is:</para>
|
|
|
-
|
|
|
+
|
|
|
+ <para>Decide on a fully-qualified domain name (FQDN), and possible aliases
|
|
|
+ for use in the <filename>/etc/hosts</filename> file. If using static
|
|
|
+ addresses, you'll also need to decide on an IP address. The syntax
|
|
|
+ for a hosts file entry is:</para>
|
|
|
+
|
|
|
<screen><literal>IP_address myhost.example.org aliases</literal></screen>
|
|
|
|
|
|
<para>Unless the computer is to be visible to the Internet (i.e., there is
|
|
@@ -216,45 +217,49 @@ EOF</userinput></screen>
|
|
|
|
|
|
<para>x can be any number in the range 16-31. y can be any number in the
|
|
|
range 0-255.</para>
|
|
|
-
|
|
|
+
|
|
|
<para>A valid private IP address could be 192.168.1.1. A valid FQDN for
|
|
|
this IP could be lfs.example.org.</para>
|
|
|
-
|
|
|
+
|
|
|
<para>Even if not using a network card, a valid FQDN is still required.
|
|
|
This is necessary for certain programs to operate correctly.</para>
|
|
|
-
|
|
|
- <para>Create the <filename>/etc/hosts</filename> file by running:</para>
|
|
|
+
|
|
|
+ <para>If using DHCP, DHCPv6, IPv6 Autoconfiguration, or if a network card
|
|
|
+ is not going to be configured, create the <filename>/etc/hosts</filename>
|
|
|
+ file by running the following command:</para>
|
|
|
|
|
|
<screen><userinput>cat > /etc/hosts << "EOF"
|
|
|
-<literal># Begin /etc/hosts (network card version)
|
|
|
+<literal># Begin /etc/hosts
|
|
|
|
|
|
-127.0.0.1 localhost
|
|
|
-::1 localhost
|
|
|
-<replaceable><192.168.0.2></replaceable> <replaceable><HOSTNAME.example.org></replaceable> <replaceable>[alias1] [alias2] ...</replaceable>
|
|
|
+127.0.0.1 <replaceable><HOSTNAME.example.org></replaceable> <replaceable><HOSTNAME></replaceable> localhost <replaceable>[alias1] [alias2] ...</replaceable>
|
|
|
+::1 <replaceable><HOSTNAME.example.org></replaceable> <replaceable><HOSTNAME></replaceable> localhost <replaceable>[alias1] [alias2] ...</replaceable>
|
|
|
|
|
|
-# End /etc/hosts (network card version)</literal>
|
|
|
+# End /etc/hosts</literal>
|
|
|
EOF</userinput></screen>
|
|
|
|
|
|
- <para>The <replaceable><192.168.0.2></replaceable> and
|
|
|
- <replaceable><HOSTNAME.example.org></replaceable> values need to be
|
|
|
- changed for specific uses or requirements (if assigned an IP address by a
|
|
|
- network/system administrator and the machine will be connected to an
|
|
|
- existing network). The optional alias name(s) can be omitted.</para>
|
|
|
-
|
|
|
- <para>If a network card is not going to be configured, create the
|
|
|
- <filename>/etc/hosts</filename> file by running:</para>
|
|
|
+ <para>The ::1 entry is the IPv6 counterpart of 127.0.0.1 and represents
|
|
|
+the IPv6 loopback interface.</para>
|
|
|
+
|
|
|
+ <para>If ussing a staic address, create the <filename>/etc/hosts</filename>
|
|
|
+ file by running this command instead:</para>
|
|
|
|
|
|
<screen role="nodump"><userinput>cat > /etc/hosts << "EOF"
|
|
|
-<literal># Begin /etc/hosts (no network card version)
|
|
|
+<literal># Begin /etc/hosts
|
|
|
|
|
|
-127.0.0.1 <replaceable><HOSTNAME.example.org></replaceable> <replaceable><HOSTNAME></replaceable> localhost
|
|
|
+127.0.0.1 localhost
|
|
|
::1 localhost
|
|
|
+<replaceable><192.168.0.2></replaceable> <replaceable><HOSTNAME.example.org></replaceable> <replaceable><HOSTNAME></replaceable> <replaceable>[alias1] [alias2] ...</replaceable>
|
|
|
|
|
|
-# End /etc/hosts (no network card version)</literal>
|
|
|
+# End /etc/hosts</literal>
|
|
|
EOF</userinput></screen>
|
|
|
|
|
|
- <para>The ::1 entry is the IPv6 counterpart of 127.0.0.1 and represents the IPv6 loopback interface.</para>
|
|
|
-
|
|
|
+ <para>The <replaceable><192.168.0.2></replaceable>,
|
|
|
+ <replaceable><HOSTNAME.example.org></replaceable>, and
|
|
|
+ <replaceable><HOSTNAME></replaceable> values need to be
|
|
|
+ changed for specific uses or requirements (if assigned an IP address by a
|
|
|
+ network/system administrator and the machine will be connected to an
|
|
|
+ existing network). The optional alias name(s) can be omitted.</para>
|
|
|
+
|
|
|
</sect2>
|
|
|
|
|
|
</sect1>
|