Solaris 11: DNS client configuration

In Solaris 11, /etc/resolv.conf is managed via SMF (Service Management Framework).

root@solaria:~# cat /etc/resolv.conf

#
# _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.

nameserver 8.8.8.8

View existing DNS configuration

svccfg -s network/dns/client listprop config
config                      application        
config/value_authorization astring     solaris.smf.value.name-service.dns.client
config/nameserver          net_address 8.8.8.8

Update existing DNS configuration

svccfg -s network/dns/client setprop config/nameserver = net_address: "(208.67.222.222 208.67.220.220)"

Export DNS configuration

svcadm refresh dns/client

This command will build a new /etc/resolv.conf based on the new settings:

nscfg export svc:/network/dns/client:default

Configure an IP address in Solaris 11

ipadm create-addr is used to assign an IP address to an interface. Its syntax:

ipadm create-addr -T address-type -a address/netmask addrobj

-T address-type refers to static, dhcp or addrconf (for automatically generated IPv6 addresses).

addrobj is an identifier for the unique IP used in the system.

dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      e1000g0

Static IP

ipadm create-ip net0

ipadm create-addr -T static -a 10.0.2.15/24 net0/v4

ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
net0/v4           static   ok           10.0.2.15/24

Dynamic IP

ipadm create-ip net0

ipadm create-addr -T dhcp net0/v4

ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
net0/v4           dhcp     ok           10.8.29.188/24