Added a few comments here and there
[linux_from_scratch.git] / newxml / chapter07 / hosts.xml
blob1fe9e45fa00773c053d2e8ac3fa52c19e68571d1
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3CR2//EN" "http://www.docbook.org/xml/4.3CR2/docbookx.dtd">
3 <sect1 id="ch07-hosts">
4 <title>Creating the /etc/hosts file</title>
5 <?dbhtml filename="hosts.html"?>
7 <para>If a network card is to be configured, you have to decide on the
8 IP-address, FQDN and possible aliases for use in the /etc/hosts file. The
9 syntax is:</para>
11 <screen>&lt;IP address&gt; myhost.mydomain.org aliases</screen>
13 <para>You should make sure that the IP-address is in the private network
14 IP-address range. Valid ranges are:</para>
16 <screen>        Class Networks
17         A     10.0.0.0
18         B     172.16.0.0 through 172.31.0.0
19         C     192.168.0.0 through 192.168.255.0</screen>
21 <para>A valid IP address could be 192.168.1.1. A valid FQDN for this IP could
22 be www.linuxfromscratch.org.</para>
24 <para>If you aren't going to use a network card, you still need to 
25 come up with a FQDN. This is necessary for certain programs to operate
26 correctly.</para>
28 <para>If a network card is not going to be configured, create the
29 <filename>/etc/hosts</filename> file by running:</para>
31 <screen><userinput>cat &gt; /etc/hosts &lt;&lt; "EOF"</userinput>
32 # Begin /etc/hosts (no network card version)
34 127.0.0.1 &lt;value of HOSTNAME&gt;.mydomain.com &lt;value of HOSTNAME&gt; localhost
36 # End /etc/hosts (no network card version)
37 <userinput>EOF</userinput></screen>
39 <para>If a network card is to be configured, create the 
40 <filename>/etc/hosts</filename> file by running:</para>
42 <screen><userinput>cat &gt; /etc/hosts &lt;&lt; "EOF"</userinput>
43 # Begin /etc/hosts (network card version)
45 127.0.0.1 localhost.localdomain localhost
46 192.168.1.1 &lt;value of HOSTNAME&gt;.mydomain.org &lt;value of HOSTNAME&gt;
48 # End /etc/hosts (network card version)
49 <userinput>EOF</userinput></screen>
51 <para>Of course, the 192.168.1.1 and &lt;value of HOSTNAME&gt;.mydomain.org
52 have to be changed to your liking (or requirements if assigned an IP-address
53 by a network/system administrator and this machine is planned to be connected
54 to an existing network).</para>
56 </sect1>