FreeBSD Handbook : PPP and SLIP : Setting up User PPP : Name Resolution Configuration
Previous: Check the tun device
Next: PPP Configuration

15.1.4. Name Resolution Configuration

The resolver is the part of the system that turns IP addresses into hostnames and vice versa. It can be configured to look for maps that describe IP to hostname mappings in one of two places. The first is a file called /etc/hosts (man 5 hosts). The second is the Internet Domain Name Service (DNS), a distributed data base, the discussion of which is beyond the scope of this document.

This section describes briefly how to configure your resolver.

The resolver is a set of system calls that do the name mappings, but you have to tell them where to find their information. You do this by first editing the file /etc/host.conf. Do not call this file /etc/hosts.conf (note the extra ``s'') as the results can be confusing.

15.1.4.1. Edit the /etc/host.conf file

This file should contain the following two lines (in this order):

   hosts
   bind

which instructs the resolver to first look in the file /etc/hosts, and then to consult the DNS if the name was not found.

15.1.4.2. Edit the /etc/hosts(5) file

This file should contain the IP addresses and names of machines on your network. At a bare minimum it should contain entries for the machine which will be running ppp. Assuming that your machine is called foo.bar.com with the IP address 10.0.0.1, /etc/hosts should contain:

   127.0.0.1    localhost
   10.0.0.1     foo.bar.com	       foo

The first line defines the alias ``localhost'' as a synonym for the current machine. Regardless of your own IP address, the IP address for this line should always be 127.0.0.1. The second line maps the name ``foo.bar.com'' (and the shorthand ``foo'') to the IP address 10.0.0.1.

If your provider allocates you a static IP address and name, then use these in place of the 10.0.0.1 entry.

15.1.4.3. Edit the /etc/resolv.conf file

/etc/resolv.conf tells the resolver how to behave. If you are running your own DNS, you may leave this file empty. Normally, you will need to enter the following line(s):

   nameserver x.x.x.x
   nameserver y.y.y.y
   domain bar.com

The x.x.x.x and y.y.y.y addresses are those given to you by your ISP. Add as many ``nameserver'' lines as your ISP provides. The ``domain'' line defaults to your hostname's domain, and is probably unnecessary. Refer to the resolv.conf manual page for details of other possible entries in this file.

If you're running ppp version 2 or greater, the ``enable dns'' command will tell ppp to request that your ISP confirms the nameserver values. If your ISP supplies different addresses (or if there are no nameserver lines in /etc/resolv.conf), ppp will rewrite the file with the ISP-supplied values.


FreeBSD Handbook : PPP and SLIP : Setting up User PPP : Name Resolution Configuration
Previous: Check the tun device
Next: PPP Configuration