Go to main content

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

Exit Print View

Updated: October 2017

How to Change the Source for a Database

This procedure describes how to specify a different source for the host database. Assume that the original source configuration for the database are files and NIS, which means that for a host lookup, the local files are searched first, and then NIS. You reconfigure the name service switch to also use DNS in host lookups.

You can use this procedure as a template to configure the sources for other name service switch databases.

Before You Begin

Make sure that the name service switch configuration reflects the actual setup of naming service on your system. For example, if you want DNS to be a source for host lookups, then DNS must be configured as well.

  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.3.

  2. (Optional) Display the current configuration of the host database.
    # svccfg -s name-service/switch listprop config/host
    config/host                 astring             "files nis"
  3. Change the source definition for the host database.
    # svccfg -s system/name-service/switch:default
    svc:/system/name-service/switch:default> setprop config/host = astring: "files dns nis"
    svc:/system/name-service/switch:default> quit
  4. Refresh the service for the name service switch.
    # svcadm refresh name-service/switch:default