Go to main content

Configuring and Managing Network Components in Oracle® Solaris 11.3

Exit Print View

Updated: December 2017
 
 

About the name-service/switch SMF Service

The name-service/switch SMF service is a configurable selection service that enables you to specify which name information service or source to use for each type of network information.

    The name service switch is used by client applications that call any of the following interfaces:

  • gethostbyname

  • getpwuid

  • getpwnam

  • getaddrinfo

The name-service/switch SMF service defines which naming service or services should be used for each network database. This information was previously stored in the /etc/nsswitch.conf file,. Although this file still exists, the configuration settings that the file contains must be modified by changing the appropriate properties in this SMF service.

You can display these properties as follows:

$ svccfg -s name-service/switch listprop config
  config                     application        
  config/default             astring     files
  config/value_authorization astring     solaris.smf.value.name-service.switch
  config/password            astring     "files ldap"
  config/group               astring     "files ldap"
  config/host                astring     "files dns"
  config/automount           astring     "files ldap"

The config/default property specifies which default source or sources are to be searched. If a particular database does not have its own property set, then the default source or sources are used. In the previous example, all of the databases, with the exception of password, group, host, and automount, use local files as their source. If a source or sources other than the default are required, a property is created for the specific database. In this example, password, groups, and automount are searched for in local files first and then in LDAP. Host lookups are searched for in local files first and then in DNS.

If you change the naming services that are enabled on your system, you must update the appropriate properties of the name-service/switch SMF service to use the correct naming service. For example, suppose that your name-service/switch was configured similarly to the previous example, and you then disabled LDAP and enabled NIS instead.

  • In this case, you would need to set the following properties of the name-service/switch service to use files and NIS:

  • config/password

  • config/group

  • config/automount

You would type the following commands to set these properties correctly:

# svccfg -s name-service/switch setprop config/password = astring: "'files nis'"
# svccfg -s name-service/switch setprop config/group = astring: "'files nis'"
# svccfg -s name-service/switch setprop config/automountconfig/password = astring: "'files nis'"
# svccfg -s name-service/switch:default refresh

For complete details, see Chapter 2, About the Name Service Switch in Working With Oracle Solaris 11.3 Directory and Naming Services: DNS and NIS and Configuring the Name Service Switch in Working With Oracle Solaris 11.3 Directory and Naming Services: DNS and NIS.