Thursday, December 12, 2013

Solaris 11- Configuring Nsswitch.conf

##Configuring nsswitch.conf
The next step is to configure the svc:/system/name-service/switch service .

solaris:~$ svccfg -s name-service/switch
svc:/system/name-service/switch> setprop config/default = files
svc:/system/name-service/switch> setprop config/host = "files dns"
svc:/system/name-service/switch> setprop config/ipnode = astring: "files dns"
svc:/system/name-service/switch> exit
solaris:~$ svcadm refresh name-service/switch
solaris:~$ svcadm restart name-service/switch

Now examine the /etc/nsswitch.conf to confirm it worked:


Solaris 11- Configuring DNS Client on the server?

Now use the svccfg to modify the svc:/network/dns/client service:
solaris:~$ svccfg -s dns/client
svc:/network/dns/client> listprop config
config application
config/value_authorization astring solaris.smf.value.name-service.dns.client
config/nameserver net_address 10.0.0.1

Modify the config/nameserver property and list the results:
svc:/network/dns/client> setprop config/nameserver = (192.168.1.1 4.2.2.2 8.8.8.8)
svc:/network/dns/client> listprop config
config application
config/value_authorization astring solaris.smf.value.name-service.dns.client
config/nameserver net_address 192.168.1.1 4.2.2.2 8.8.8.8

Add the config/search and config/domain properties and list the results:
svc:/network/dns/client> setprop config/search = xyz.com
svc:/network/dns/client> setprop config/domain = xyz.com
svc:/network/dns/client> listprop config
config application
config/value_authorization astring solaris.smf.value.name-service.dns.client
config/nameserver net_address 192.168.1.1 4.2.2.2 8.8.8.8
config/search astring xyz.com
config/domain astring xyz.com
svc:/network/dns/client> exit

Finally refresh and restart the dns/client service:
solaris:~$ svcadm refresh dns/client
solaris:~$ svcadm restart dns/client


Solaris 11 - How to change the hostname of the server?

1 - To check the current environment properties:
root@solaris:~# svccfg -s system/identity:node listprop config
config                 application        
config/enable_mapping boolean     true
config/nodename       astring     solaris
config/loopback       astring     solaris
2 - Set the new hostname
root@solaris:~# svccfg -s system/identity:node setprop config/nodename="my-host-name"
root@solaris:~# svccfg -s system/identity:node setprop config/loopback="my-host-name"
3- Refresh the properties:
root@solaris:~# svccfg -s system/identity:node refresh
4 - Restart the service:
root@solaris:~# svcadm restart system/identity:node
5 - verify that the changes took place:
root@solaris:~# svccfg -s system/identity:node listprop config
config                 application       
config/enable_mapping boolean     true
config/nodename       astring     my-host-name
config/loopback       astring     my-host-name
root@solaris:~# hostname

my-host-name