Each line in the /etc/nsswitch.conf
file has the following syntax:
lookup_type name_service [status=action status=action ...] name_service ... |
If you include any status=action
pairs after a name service, the square brackets are required.
- lookup_type
The type of information to be looked up. The supported
keywords and the information types they represent are listed in
Table 5-1 “Types
of Lookups Controlled by the Name Service Switch”. These keywords are case-sensitive.
- name_service
One of the following name services to use for the
type of information in the lookup_type
field. These keywords must be in lowercase.
- files
Files in the /etc
directory on the local host (/etc/hosts,
/etc/services, and so on).
- nis
Network Information Service (NIS).
- dns
Domain Name System (DNS), which is implemented by
Berkeley Internet Name Domain (BIND) on HP-UX. See the Installing
and Administering Internet Services manual for more
information. The dns keyword may
be used only on the line beginning with hosts.
- status
One of the following statuses returned by a name
service query. These values may be entered in uppercase or lowercase.
- SUCCESS
The lookup was successful, and the requested information
was found.
- NOTFOUND
The name service returned a response, but the requested
data was not in its database.
- UNAVAIL
The name service is not configured.
- TRYAGAIN
The name service was busy and the request timed
out. This value is returned only by DNS.
- action
The action to take based on the status of the name
service query. The following values may be entered in uppercase
or lowercase.
- continue
Try the next name service in the list.
- return
End the lookup and return control to the calling
process without consulting the next name service in the list.
If a line beginning with one of the lookup_types
does not exist in the /etc/nsswitch.conf
file, the default Name Service Switch configuration for that type
of information is used. If the /etc/nsswitch.conf
file does not exist, the default configuration is used for every
type of information. The default Name Service Switch configuration
is described in “Default Configuration”.
Table 5-1 Types
of Lookups Controlled by the Name Service Switch
| Keyword | Type of Information Represented by Keyword |
|---|
automount | NFS automounter maps stored in files
like /etc/auto_master and /etc/auto_home
or in NIS maps like auto.master
and auto.home. |
hosts | Host names and IP addresses stored in
the /etc/hosts file or the NIS
hosts.byaddr and hosts.byname
maps. |
netgroup | NFS netgroups stored in the /etc/netgroup
file or the NIS netgroup, netgroup.byhost
and netgroup.byuser maps. |
networks | Network names and IP addresses stored in the
/etc/networks file or the NIS networks.byaddr
and networks.byname maps. |
protocols | Networking protocol names and numbers stored
in the /etc/protocols file or the
NIS protocols.byname and protocols.bynumber
maps. |
rpc | RPC program names and numbers stored
in the /etc/rpc file or the NIS
rpc.byname and rpc.bynumber
maps. |
services | Mapping of networking services to port numbers
and protocols, stored in the /etc/services
file or the NIS services.byname
and services.bynp maps. |