The filer resolves host names by searching maps or databases for services to use. The filer tries name resolution services in a default order or in the order that you specify in the /etc/nsswitch.conf file in the root volume.
By default, first the filer tries to resolve host names locally by searching the /etc/hosts file in the root volume and in the /etc/nsswitch.conf file in the root volume. If it cannot resolve the host name, the filer tries NIS, if NIS is enabled. If the filer still cannot resolve the host name, the filer requests services from a DNS server, if DNS is enabled. You can specify any or all of the resolution methods.
The following table shows the default search order for each map.
| Map | Services in search order |
|---|---|
| hosts | root files, NIS, DNS |
| passwd | root files, NIS |
| netgroup | root files, NIS |
| group | root files, NIS |
| shadow | root files, NIS |
To specify a different order in which the filer contacts host name services, create the /etc/nsswitch.conf file in the root volume. Each line must have the following format:
map: service ...
Parameter Description map One of the following maps or databases: hosts, passwd, netgroup, group, or shadow.
service One or more of the following:
You can list services in the order in which you want the filer to contact the services. For example, the following file instructs the filer to contact first NIS for hosts, then DNS, and finally local files in /etc in the root volume. For passwords, the contact order is NIS, then local files in /etc in the root volume.
hosts: nis dns files
passwd: nis files
When the filer resolves a host, the search stops.
Note: When performing CIFS operations, the filer can use WINS servers for host name service. However, filer commands unrelated to CIFS use the /etc/hosts file, DNS, or NIS to resolve host names, as described in the following sections.
The filer can use the /etc/hosts file in the root volume to resolve host names used in the /etc/rc, /etc/syslog.conf, /etc/dgateways, /etc/exports, /etc/netgroup, and /etc/hosts.equiv root volume files. If you do not use any host names, you do not need /etc/hosts.
By default, the filer reads the /etc/hosts file in the root volume whenever it needs to resolve host names, so changes to the file take effect immediately. If you change the IP address for an interface, the new IP address doesn't take effect until you reboot the filer and execute the appropriate ifconfig command from /etc/rc. It is safest to reboot the filer after changing any /etc file to make sure that the new configuration works correctly.
The filer looks up host addresses in /etc/hosts in the root volume before sending queries to the DNS server. Therefore, it is important that each entry in /etc/hosts contains accurate information.
To reduce the need for updating information in /etc/hosts in the root volume, when using DNS, keep only a minimum number of entries in /etc/hosts.
You can do one of the following actions:
You can put the following line at the end of the NIS Makefile section for hosts.time:
@mntdir=/tmp/netapp_etc_mnt_$$$$;\
if [ ! -d $$mntdir ]; then rm -f $$mntdir; mkdir $$mntdir; fi;\
for filer in toaster1 toaster2 toaster3 ; do \
mount $$filer:/etc $$mntdir;\
mv $$mntdir/hosts $$mntdir/hosts.bak;\
cp /etc/hosts $$mntdir/hosts;\
umount $$mntdir;\
done;\
rmdir $$mntdir
Substitute the name of each filer in the "for filer in..." list in place of toaster1, toaster2, and so on.
The filer includes DNS client capabilities to query DNS servers for host-name-to-IP-address and IP-address-to-host-name translation services. With DNS enabled, you no longer have to update the filer's /etc/hosts file in the root volume every time you add a new host to the network. (If you use the default search order or put files before DNS in the /etc/nsswitch.conf file, you still have to update the /etc/hosts file if one of its entries changes before the filer tries to resolve host names.)
Note: To prevent naming inconsistencies, Network Appliance recommends that when you enable DNS, you use only the default /etc/hosts file in the root volume.
At setup, if you enter y in response to the following prompt, setup prompts you for a DNS domain name, as follows:
Do you want to run DNS resolver [n]: y
Please enter DNS domain name []:
After you enter a DNS domain name, setup prompts you for the IP addresses for up to three DNS name servers. Based on the IP addresses you enter, setup generates the /etc/resolv.conf file in the root volume. Entries in /etc/resolv.conf file consist of the word "nameserver" followed by an IP address, as follows:
nameserver ip_address
For details about name server query policies, see the na_resolv.conf(5) man page.
If you didn't start DNS during setup, you can start DNS using the following procedure.
To disable DNS, enter the following command or put the command in the /etc/rc file in the root volume to make the change permanent:
options dns.enable off
To change your DNS domain name, enter the following command or put the command in the /etc/rc file in the root volume to make the change permanent:
options dns.domainname domainname
The filer includes NIS client capabilities to query NIS servers for host-name-to-IP-address and IP-address-to-host-name translation services.
Note: Because the nsswitch.conf file already enables you to specify the order in which the filer finds password information, you do not need to use + or - entries in the filer's /etc/passwd file in the root volume. Any existing + or - entries are ignored.
The filer uses the following NIS maps:
hosts.byname
hosts.byaddr
passwd.byname
passwd.byuid
passwd.adjunct
group.byname
group.bygid
netgroup.byhost
Shadow password information is obtained from the passwd.byname map.
During setup, the following prompt appears:
Do you want to run NIS Client [n]:
If you enter y, setup prompts you for an NIS domain name, as follows:
Please enter NIS domain name [] :
Enter an NIS domain name.
If you didn't start NIS during setup, you can start NIS using the following procedure.
To disable NIS on a running system, enter the following command, or put the command in the /etc/rc file in the root volume to make the change permanent:
options nis.enable off
To change the domain name on a running system, enter the following command or put the command in the /etc/rc file in the root volume to make the change permanent:
options nis.domainname new.domain
To display the NIS server name, enter the following command:
ypwhich
The ypwhich command has no options.
Copyright © 1999, Network Appliance, Inc. All rights reserved.
Part No. 210-02334
File: net3.htm
Last updated: 04/26/99 08:11:18