(originally published on 01.06.2014, reviewed/rewritten on 26.04.2025, tested on Oracle Solaris 11.4 SRU 80)
 

This is yet another small feature of Solaris, that is really helpful.

Let’s assume you want to change the IP number of the DNS server. You could use the normal svccfg –s dns/client setprop config/nameserver = net_address: 192.168.1. command. However sometimes you don’t know the correct property to change. Or just can’t remember it.

In my example the server starts with the following value for the name server property. I would like to change it to `192.168.3.1’:

root@testbed:~# svcprop -p config/nameserver svc:/network/dns/client:default
192.168.1.1

Of course, with the information i used in this command, it’s faster to use the direct svccfg setpropmethod shown before, however I just use it here to show you how the following command works.

Instead of using the command to change the property mentioned above, you can use svccfg -s svc:/network/dns/client:default editprop. With this command you can change the properties of the SMF service /network/dns/client as well . However you don’t have to memorize the property names. The command show them to you and gives you a mechanism to alter the properties. It’s done by offering you a file with all relevant properties, some explanation and a line to do a refresh of the SMF service. It fires up an vi (or whatever you’ve configured your EDITOR or VISUAL environment variable) and displays the following data in the editor.

##
## 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 are defined in the selected instance
## (svc:/network/dns/client:default)

##
## The IP address of a DNS nameserver to be used by the resolver.
##
# setprop config/nameserver = net_address: 192.168.1.1

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

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


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

When you want to to change some properties just remove the # in front of the line you want to change, change the value of the property and remove the ``` in front of the last line containing # refresh.

The file in the editor should now look like this (I’m omitting the lines with double-#):

setprop config/nameserver = net_address: 192.168.3.1
# setprop config/value_authorization = astrng: solaris.smf.value.name-service.dns.client
refresh

As soon as you savequit the editor, the SMF service is updated and refreshed.

root@testbed:~# svcprop -p config/nameserver svc:/network/dns/client:default
192.168.3.1

Really useful when you can’t remember the necessary magic incantations for SMF configuration via setprop

Written by

Joerg Moellenkamp

Grey-haired, sometimes grey-bearded Windows dismissing Unix guy.