hosts.xml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-scripts-hosts">
  7. <title>Creating the /etc/hosts file</title>
  8. <?dbhtml filename="hosts.html"?>
  9. <indexterm zone="ch-scripts-hosts"><primary sortas="e-/etc/hosts">/etc/hosts</primary></indexterm>
  10. <indexterm zone="ch-scripts-hosts">
  11. <primary sortas="d-localnet">localnet</primary>
  12. <secondary>/etc/hosts</secondary></indexterm>
  13. <indexterm zone="ch-scripts-hosts">
  14. <primary sortas="d-network">network</primary>
  15. <secondary>/etc/hosts</secondary></indexterm>
  16. <para>If a network card is not going to be configured, create the
  17. <filename>/etc/hosts</filename> file by running:</para>
  18. <screen><userinput>cat &gt; /etc/hosts &lt;&lt; "EOF"
  19. # Begin /etc/hosts (no network card version)
  20. 127.0.0.1 <replaceable>[&lt;value of HOSTNAME&gt;.example.org]</replaceable> <replaceable>[value of HOSTNAME]</replaceable> localhost
  21. # End /etc/hosts (no network card version)
  22. EOF</userinput></screen>
  23. <para>If a network card is to be configured, create the
  24. <filename>/etc/hosts</filename> file by running:</para>
  25. <screen><userinput>cat &gt; /etc/hosts &lt;&lt; "EOF"
  26. # Begin /etc/hosts (network card version)
  27. 127.0.0.1 localhost
  28. <replaceable>[192.168.1.1]</replaceable> <replaceable>[&lt;value of HOSTNAME&gt;.example.org]</replaceable> <replaceable>[value of HOSTNAME]</replaceable>
  29. # End /etc/hosts (network card version)
  30. EOF</userinput></screen>
  31. </sect1>