Related Topics:
 • System Files...
 


 The Resolv.conf File


A very small, but very powerful file...

The resolv.conf file resides in the /etc directory and contains the IPs of domain name servers that you will probably need if you are going to do anything on the internet! You can think of a domain name server as a huge automated phone book which gives you back a number (an IP) when you send it a name. Any name that is invoked by a process on your system will either look in the hosts file or, more likely, send a query to a domain name server listed in the resolv.conf file.

Presently on Linux systems, this file will only reference three (3) domain name servers. For my ISP (inet) machine, I have listed all three IPs that were given to me by my ISP as valid domain name servers. However, I have a resolv.conf file with only one (1) name on it residing on the bambi machine. This file says that the JNOS IP is the name server! ( JNOS has a name service built into it! And that is where the domain.txt file comes into play! You don't have to run "named" to avail your system of this service when using JNOS!)

Of course, if you do decide to run "named," you will only need a very minimal hosts file, just for booting up. And, if your "named" database is extensive, you may not even need the resolv.conf file... If you are just beginning with Linux, I would not run "named" right away unless you are a network guru :)

The resolv.conf file is among the very first files queried when any network activity is initiated. If you are having any net troubles, look here first for possible errors. If you are wondering why mail is not going across your local area network, look here for the problem before you start diving down too deep into the system! A simple test after an install or upgrade is to run nslookup, a process that absolutely needs to know about the domain name server IPs in resolv.conf!




A Few of My Resolv.conf Files

This is the resolv.conf file for the desktop machine, the one that goes out over the inet. (The x's, y's, and z's are really numbers, but I have not listed them here.)

/etc/resolv.conf

# resolv.conf
# 08-29-02
# Can only have three servers active
# search .
# domain ampr.org
nameserver 204.xxx.yyy.1
nameserver 204.xxx.yyy.2
nameserver 204.xxx.zzz.1
# nameserver 44.56.26.11

This is the resolv.conf that resides on the bambi.ampr.org machine. I have given it a "hint" by adding a backup, or default, domain range of ampr.org. And, by using the 44.56.26.11 address, I am sending all domain queries to the JNOS application to be resolved in its domain.txt file, which is a database of names matching their respective IP (numerical) addresses.

# For Wellesley
# 08-05-00
# Search and domain are mutually exclusive!
# search .
#
domain          ampr.org
#
# The local JNOS host 'machine'...
nameserver      44.56.26.11
# nameserver    44.56.26.10
#

To expand a bit on the domain key word... this will take effect after an initial search of the .11's domain.txt file. For example, let's say you did a ping on ka1fsb without any other notation. When this lookup fails, the domain key word will then append the ampr.org to the ka1fsb, building a complete domain name or FQDN, resulting in ka1fsb.ampr.org. The second time around, this name will be found and resolved to its IP number.

A further observation might yield the conclusion that this configuration is a most restrictive one. This system is limited to just what can be found in the local domain.txt file. While some of these domain files are no doubt very, very large, they cannot compete with network domain servers which have a googleplex of names available to them, since they in turn are linked into many other domain name server networks themselves! So in short, it is probably better, more exhaustively comprehensive, to include an IP address for a network domain name server, which your ISP can provide. See file below...

Even if you use a network domain name server (IP number), you may still keep the domain keyword and its data field, ampr.org. You may then telnet or ping ka1fsb without the trailing ampr.org! No matter where the domain services reside, local or network, they behave identically.

NOTE: You may also use both a local domain.txt file and an IP reference to a network domain name service. In the example below, the search would begin "locally" and, on fail, would procede to the network name server(s) for a probable match.

# For Wellesley
# 08-05-00
# Search and domain are mutually exclusive!
# search .
#
domain          ampr.org
#
# The local JNOS host 'machine'...
nameserver      44.56.26.11
# nameserver    44.56.26.10
#
# Possible "external" domain name server address(es)...
nameserver      204.127.129.x
nameserver      204.xxx.xxx.x
#


(Courtesy KBNorton Computer Services)