aboutsummaryrefslogtreecommitdiffstats
path: root/chapter07/hosts.xml
blob: bc81d39e8e6a59b4c9f0d1d59df0ea7e2d1f53a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>
<sect1 id="ch-scripts-hosts">
<title>Creating the /etc/hosts File</title>
<?dbhtml filename="hosts.html"?>

<para>If a network card is to be configured, create the 
<filename>/etc/hosts</filename> file by running:</para>

<screen><userinput>cat &gt; /etc/hosts &lt;&lt; "EOF"
<literal># Begin /etc/hosts (network card version)

127.0.0.1 localhost
<replaceable>[192.168.1.1]</replaceable> <replaceable>[&lt;HOSTNAME&gt;.example.org]</replaceable> <replaceable>[HOSTNAME]</replaceable>

# End /etc/hosts (network card version)</literal>
EOF</userinput></screen>

<para>If a network card is not going to be configured, create the
<filename>/etc/hosts</filename> file by running:</para>

<screen><userinput>cat &gt; /etc/hosts &lt;&lt; "EOF"
<literal># Begin /etc/hosts (no network card version)

127.0.0.1 <replaceable>[&lt;HOSTNAME&gt;.example.org]</replaceable> <replaceable>[HOSTNAME]</replaceable> localhost

# End /etc/hosts (no network card version)</literal>
EOF</userinput></screen>

</sect1>