How to disable NIS client on Solaris 10

This is a simple post providing the necessary steps to disable NIS client on Solaris 10.

  1. Verify that you don't have any references to nis in /etc/nsswitch.conf
    # grep nis /etc/nsswitch.conf
    If entries are displayed use your favourite text editor and make the adjustments.
  2. Disable both nis client and server:
    # svcadm disable nis/client
    # svcadm disable nis/server
  3. Confirm services disabled:
    # svcs -a|grep nis
    disabled Jul_04 svc:/network/rpc/nisplus:default
    disabled Jul_04 svc:/network/nis/server:default
    disabled Jul_04 svc:/network/nis/passwd:default
    disabled Jul_04 svc:/network/nis/update:default
    disabled Jul_04 svc:/network/nis/xfr:default
    disabled Jul_04 svc:/network/nis/client:default
    If any NIS service still not disabled, manually disable before continuing.
  4. Remove NIS tables
    # rm -r /var/yp/`domainname`
    # rm -r /var/yp/binding/`domainname`
    # rm -r /var/yp/security
    # rm /var/yp/*.time
  5. Clear the domainname file:
    # mv /etc/defaultdomain /etc/defaultdomain.saved