|
|
Installing and Administering Internet Services: HP 9000 Networking > Chapter 2 Installing and Configuring Internet
ServicesConfiguring the Name Service Switch |
|
The Name Service Switch determines where your system will look for the information that is traditionally stored in the following files:
For all types of information except host information, you can configure your system to use NIS (one of the NFS Services), NIS+ (the next generation of NIS), or the local /etc file, in any order. However, we recommend that you do not configure your system to use both NIS and NIS+. For host information, you can configure your system to use BIND (DNS), NIS, NIS+, or the /etc/hosts file. As mentioned above, we recommend that you do not configure your system to use both NIS and NIS+. The default Name Service Switch configuration is adequate for most installations, so you probably do not have to change it. The default configuration is explained in “Default Configuration”. Beginning with the earlier HP-UX 10.30 release, the Name Service Switch has a different default behavior from the Name Service Switch in previous releases. If you have been using the pre-10.30 default Name Service Switch configuration (or if you do not have an /etc/nsswitch.conf file), and you want your host to continue to have that same pre-10.30 behavior, copy the /etc/nsswitch.hp_defaults file to /etc/nsswitch.conf. See “Default Configuration”. Also, for more information about the Name Service Switch configuration files supplied in the /etc directory, see Installing and Administering NFS Services. The ability to consult more than one name service for host information is often called hostname fallback. The Name Service Switch provides client-side hostname fallback, because it is incorporated into client-side programs (for example, gethostbyname), which request host information. The Network Information Service (NIS), one of the NFS Services, allows you to configure a server-side hostname fallback. This feature causes the NIS or NIS+ server to query BIND when it fails to find requested host information in its database. The NIS or NIS+ server then returns the host information to the client through NIS or NIS+. This server-side hostname fallback is intended for use with clients like PCs that do not have a feature like the Name Service Switch. Hewlett-Packard recommends that you use the Name Service Switch if possible, instead of the server-side hostname fallback provided by NIS and NIS+. For more information about the NIS server-side hostname fallback, see Installing and Administering NFS Services.
For more information about configuring the Name Service Switch, including the syntax of the configuration file and customizing your configuration, see Installing and Administering NFS Services. You can also type man 4 nsswitch.conf at the HP-UX prompt. Hewlett-Packard recommends that you maintain at least a minimal /etc/hosts file that includes important addresses like gateways, diskless boot servers and root servers, and your host's own IP address. Hewlett-Packard also recommends that you include the word files in the hosts line to help ensure a successful system boot using the /etc/hosts file when BIND and NIS are not available. If the /etc/nsswitch.conf file does not exist, or if the line for a particular type of information is absent or syntactically incorrect, the following default configuration is used:
If your /etc/nsswitch.conf file contains a syntactically correct line for a particular type of information, that line is used instead of the default. For more information about configuring the Name Service Switch, including the syntax of the configuration file and customizing your configuration, see Installing and Administering NFS Services. Issue the nsquery command to perform a hosts, passwd, or group lookup, as follows:
The lookup_type can be hosts, passwd, or group. The lookup_query can be a host name or IP address, a user name or user ID, or a group name or group ID. The nsquery command displays the Name Service Switch configuration that is currently in use. Then, it displays the results of the query. The following example uses nsquery to perform a lookup of the host name romney:
As an optional third argument to nsquery, you can supply a Name Service Switch configuration in double quotes, as in the following example:
For more information, type man 1 nsquery at the HP-UX prompt. |
|