NameService

From pressy's brainbackup
Jump to: navigation, search

NameService Settings Solaris 11

yes, step by step will come everything into the Solaris SMF ;)

DNS Solaris 11 Settings


# svccfg
svc:> select dns/client
svc:/network/dns/client> setprop config/search = astring: ("pressy.net" "haha.at" "narf.de")
svc:/network/dns/client> setprop config/nameserver = net_address: ( 192.168.0.100 8.8.8.8 )
svc:/network/dns/client> select dns/client:default
svc:/network/dns/client:default> refresh
svc:/network/dns/client:default> validate
svc:/network/dns/client:default> select name-service/switch
svc:/system/name-service/switch> setprop config/host = astring: "files dns"
svc:/system/name-service/switch> select system/name-service/switch:default
svc:/system/name-service/switch:default> refresh
svc:/system/name-service/switch:default> validate
svc:/system/name-service/switch:default> exit
# svcadm enable dns/client
# svcadm refresh name-service/switch
# grep host /etc/nsswitch.conf
hosts:  files dns
# cat /etc/resolv.conf
#
# copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
#

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#   DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See resolv.conf(4) for details.

search    pressy.net haha.at narf.de
nameserver    192.168.0.100
nameserver    8.8.8.8

With Solaris 11.1, you got a new feature ;) This will read your legacy written /etc/resolv.conf and configure the SMF service:

# nscfg import -f svc:/network/dns/client:default

Another nice feature to change SMF properties "editprop", but it only works for already defined parameters:

# svccfg -s svc:/network/dns/client:default editprop
-----
##
## Change property values by removing the leading '#' from the
## appropriate lines and editing the values. svccfg subcommands
## such as delprop can also be added to the script.
##

## Property group "config"

## The following properties inherit from the parent service
## (svc:/network/dns/client)

# setprop config/value_authorization = astring: solaris.smf.value.name-service.dns.client

##
## The value used to construct the "nameserver" directive in resolv.conf(4).
##
# setprop config/nameserver = net_address: 8.8.8.8


## Uncomment to apply these changes to this instance.
# refresh