old-www/HOWTO/PPP-HOWTO/dns.html

320 lines
6.0 KiB
HTML

<HTML
><HEAD
><TITLE
>Setting up Name to Address Resolution (DNS)</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.52"><LINK
REL="HOME"
TITLE="Linux PPP HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Testing your modem for dial out"
HREF="x808.html"><LINK
REL="NEXT"
TITLE="The /etc/host.conf file"
HREF="x892.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
><A
HREF="http://www.linuxports.com/howto/ppp"
TARGET="_top"
>Linux PPP HOWTO</A
></TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x808.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x892.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="DNS"
>Chapter 13. Setting up Name to Address Resolution (DNS)</A
></H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>13.1. <A
HREF="dns.html#AEN877"
>The <TT
CLASS="LITERAL"
>/etc/resolv.conf</TT
> file</A
></DT
><DT
>13.2. <A
HREF="x892.html"
>The <TT
CLASS="LITERAL"
>/etc/host.conf</TT
> file</A
></DT
></DL
></DIV
><P
>Whilst we humans like to give names to things, computers really like
numbers. On a TCP/IP network (which is what the Internet is), we call
machines by a particular name - and every machine lives in a
particular domain. For example, my Linux workstation is called
<I
CLASS="EMPHASIS"
>archenland</I
> and it resides in the <I
CLASS="EMPHASIS"
>interweft.com.au</I
>
domain. Its human readable address is thus archenland.interweft.com.au (which is known as
the FQDN - fully qualified domain name).</P
><P
>However, for this machine to be found by other computers on the
Internet, it is actually known by its IP number when computers are
communicating across the Internet.</P
><P
>Translating (resolving) machine (and domain) names into the numbers
actually used on the Internet is the business of machines that offer the
Domain Name Service.</P
><P
>What happens is this:-</P
><P
>&#13;<P
></P
><UL
><LI
><P
> your machine needs to know the
IP address of a particular computer. The application requiring this
information asks the 'resolver' on your Linux PC to provide this
information;&#13;</P
></LI
><LI
><P
>the resolver queries the local host file (<TT
CLASS="LITERAL"
>/etc/hosts</TT
>
and/or the domain name servers it knows about (the exact behaviour of
the resolver is determined by <TT
CLASS="LITERAL"
>/etc/host.conf</TT
>);&#13;</P
></LI
><LI
><P
>if the answer is found in the host file, this answer is returned;&#13;</P
></LI
><LI
><P
>if a domain name server is specified, your PC queries this
machine;&#13;</P
></LI
><LI
><P
>if the DNS machine already knows the IP number for the required
name, it returns it. If it does not, it queries other name servers across
the Internet to find the information. The name server than passes this
information back to the requesting resolver - which gives the
information to the requesting application.</P
></LI
></UL
>&#13;</P
><P
>When you make a PPP connection, you need to tell your Linux machine
where it can get host name to IP number (address resolution) information
so that <I
CLASS="EMPHASIS"
>you</I
> can use the machine names but your <I
CLASS="EMPHASIS"
>computer</I
> can
translate these to the IP numbers it needs to do its work.</P
><P
>One way is to enter every host that you want to talk to into the
<TT
CLASS="LITERAL"
>/etc/hosts</TT
> file (which is in reality totally impossible if you are
connecting to the Internet); another is to use the machine IP numbers as
opposed to the names (an impossible memory task for all but the smallest
LANs).</P
><P
>The best way is to set up Linux so that it knows where to go to get this
name to number information - automatically. This service is provided by
the Domain Name Server (DNS) system. All that is necessary is to enter
the IP number(s) for the domain name servers into your /etc/resolv.conf file.</P
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN877"
>13.1. The <TT
CLASS="LITERAL"
>/etc/resolv.conf</TT
> file</A
></H1
><P
>Your PPP server sysadmin/user support people should provide you with two
DNS IP numbers (only one is necessary - but two gives some
redundancy in the event of failure).</P
><P
>As previously mentioned, Linux cannot set its name server IP number
in the way that MS Windows 95 does. So you must <I
CLASS="EMPHASIS"
>insist</I
> (politely) that
your ISP provide you with this information!</P
><P
>Your <TT
CLASS="LITERAL"
>/etc/resolv.conf</TT
> should look something like :-</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>domain your.isp.domain.name
nameserver 10.25.0.1
nameserver 10.25.1.2</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>Edit this file (creating it if necessary) to represent the information
that your ISP has provided. It should have ownership and permissions as
follows :-</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>-rw-r--r-- 1 root root 73 Feb 19 01:46 /etc/resolv.conf</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>If you have already set up a <TT
CLASS="LITERAL"
>/etc/resolv.conf</TT
> because you are on a
LAN, simply add the IP numbers of the PPP DNS servers to your
existing file.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x808.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x892.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Testing your modem for dial out</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>The <TT
CLASS="LITERAL"
>/etc/host.conf</TT
> file</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>