I l@ve RuBoard |
9.7 Configuring the Order in Which a Resolver Uses DNS, /etc/hosts, and NIS9.7.1 ProblemYou want to configure the order in which a system's resolver consults various naming services. 9.7.2 SolutionSome vendor's BIND resolvers support configuration of the order in which the resolvers look up names using the various naming services they support. These naming services may include DNS, NIS, NIS+ and /etc/hosts. On the Solaris and HP-UX operating systems, as well as recent versions of Linux and Irix, resolver service order is configured using the nsswitch.conf file, which usually resides in the /etc directory. Lines in nsswitch.conf begin with the name of a database, followed by a colon and a list of one or more sources. For the resolver, the database name is hosts, and the possible sources are:
The resolver tries the sources in the order listed, so to tell the resolver to check /etc/hosts before querying a name server, you could add this line to nsswitch.conf: hosts: files dns By default, the resolver continues to the next source if the previous isn't available or can't find a name. You can modify this behavior by adding condition=action clauses between source names. The possible conditions are:
The supported actions are either return (return the result from the previous source) or continue (go on to the next source). The clause is written in square brackets: hosts: files [notfound=continue] dns On Windows 95, 98, and ME, you can configure resolver service order by adding subkeys to the following Registry key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP\ServiceProvider The four Registry subkeys, each a signed, 16-bit number in hexadecimal format, control the order in which the Windows resolver uses the HOSTS and LMHOSTS files, name servers, and NBT queries to resolve names:
The lower the value of the key, the earlier the resolver uses that naming service. Deleting a subkey prevents the resolver from using the corresponding service. 9.7.3 DiscussionSome older versions of Linux support configuration of the service order using a file called host.conf; try man host.conf to see if your version does. The only support in Windows NT 4.0 and Windows 2000 for configuring the service order is a single Registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DnsNbtLookupOrder The default value, 0, tells the resolver to query name servers before using NBT queries. Set the value to 1 to instruct the resolver to use NBT queries first. 9.7.4 See Also"Vendor-Specific Options" in Chapter 6 of DNS and BIND. |
I l@ve RuBoard |