From bd4a1d9bf993e0481da9365e9174213251b93a45 Mon Sep 17 00:00:00 2001 From: DJ Lucas Date: Wed, 8 Mar 2017 00:47:35 +0000 Subject: Update /etc/hosts in network configuration. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11204 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter07/network.xml | 17 +++++++++++++---- chapter07/networkd.xml | 19 +++++++++++++------ 2 files changed, 26 insertions(+), 10 deletions(-) (limited to 'chapter07') diff --git a/chapter07/network.xml b/chapter07/network.xml index f95f0e26d..942276478 100644 --- a/chapter07/network.xml +++ b/chapter07/network.xml @@ -267,13 +267,18 @@ EOF # Begin /etc/hosts (network card version) 127.0.0.1 localhost -<192.168.1.1> <HOSTNAME.example.org> [alias1] [alias2 ...] +127.0.1.1 <FQDN> <HOSTNAME> +<192.168.1.1> <FQDN> <HOSTNAME> [alias1] [alias2 ...] +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters # End /etc/hosts (network card version) EOF - The <192.168.1.1> and - <HOSTNAME.example.org> values need to be + The <192.168.1.1>, + <FQDN>, and + <HOSTNAME> 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. @@ -284,7 +289,11 @@ EOF cat > /etc/hosts << "EOF" # Begin /etc/hosts (no network card version) -127.0.0.1 <HOSTNAME.example.org> <HOSTNAME> localhost +127.0.0.1 localhost +127.0.1.1 <FQDN> <HOSTNAME> +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters # End /etc/hosts (no network card version) EOF diff --git a/chapter07/networkd.xml b/chapter07/networkd.xml index 2087bc70f..1ce19b8c1 100644 --- a/chapter07/networkd.xml +++ b/chapter07/networkd.xml @@ -237,14 +237,18 @@ EOF cat > /etc/hosts << "EOF" # Begin /etc/hosts -127.0.0.1 <HOSTNAME.example.org> <HOSTNAME> localhost [alias1] [alias2] ... -::1 <HOSTNAME.example.org> <HOSTNAME> localhost [alias1] [alias2] ... +127.0.0.1 localhost +127.0.1.1 <FQDN> <HOSTNAME> +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters # End /etc/hosts EOF The ::1 entry is the IPv6 counterpart of 127.0.0.1 and represents -the IPv6 loopback interface. + the IPv6 loopback interface. 127.0.1.1 is a loopback entry reserved + specifically for the FQDN. If using a static address, create the /etc/hosts file by running this command instead: @@ -253,14 +257,17 @@ the IPv6 loopback interface. # Begin /etc/hosts 127.0.0.1 localhost -::1 localhost -<192.168.0.2> <HOSTNAME.example.org> <HOSTNAME> [alias1] [alias2] ... +127.0.1.1 <FQDN> <HOSTNAME> +<192.168.0.2> <FQDN> <HOSTNAME> [alias1] [alias2] ... +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters # End /etc/hosts EOF The <192.168.0.2>, - <HOSTNAME.example.org>, and + <FQDN>, and <HOSTNAME> 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 -- cgit v1.2.3-54-g00ecf