Go to main content

Working With Oracle® Solaris 11.4 Directory and Naming Services: DNS and NIS

Exit Print View

Updated: November 2020
 
 

How to Configure a Search Criterion for a Database

The name service switch has default search criteria, as explained in Default Search Criteria for the Name Service Switch.

This procedure describes how to redefine the search mechanism for the host database when the information is not found at the first source. The search mechanism must stop instead of proceeding to search the next source.

  1. Become an administrator.

    For more information about obtaining the appropriate rights to perform specific tasks, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.4.

  2. (Optional) Display the current configuration of the host database.
    # svccfg -s name-service/switch listprop config/host
    config/host              astring             "files dns nis"
    
  3. Create a new search criterion for the host database lookups when information is not found at the first source.
    # svccfg -s system/name-service/switch
    svc:/system/name-service/switch> setprop config/host = \
    astring: "files [NOTFOUND=return] dns nis"
    svc:/system/name-service/switch> quit

    With this configuration, the search mechanism for the network database uses the default search criteria for the SUCCESS status and UNAVAILABLE status. However, if the information is not found, the search stops immediately.

  4. Refresh the service for the name service switch.
    # svcadm refresh name-service/switch