Removing NIS from a Solaris system

This simple article provides the quick steps to completely remove NIS from a Master Server, from a Slave Server, or from a NIS client.

Personally, I would remove NIS in the following order:

Master Server

Use these steps to remove NIS from the Master Server

  1. Login the master server as root
  2. Remove the NIS domainname file:
    # rm /etc/defaultdomain
  3. Copy the name servers .files into place:
    # cp /etc/nsswitch.files /etc/nsswitch.conf
    If you have DNS services, edit the hosts entry in the /etc/nsswitch.conf file to read:
    hosts: files dns
  4. Change directory to the NIS repository:
    # cd /var/yp
  5. Remove ALL timestamp files:
    # rm *.time
  6. Remove the NIS <domainname> directory. For example:
    # rm -rf mydomain.example.com
  7. Remove the NIS binding file
    # rm binding
  8. Reboot the server
    # init 6

Slave Server

Use these steps to remove NIS from the Slave Server

  1. Login the slave server as root
  2. Remove the NIS domainname file:
    # rm /etc/defaultdomain
  3. Copy the name servers .files into place:
    # cp /etc/nsswitch.files /etc/nsswitch.conf
    If you have DNS services, edit the hosts entry in the /etc/nsswitch.conf file to read:
    hosts: files dns
  4. Change directory to the NIS repository:
    # cd /var/yp
  5. Remove the NIS <domainname> directory. For example:
    # rm -rf mydomain.example.com
  6. Remove the NIS binding file
    # rm binding
  7. Reboot the server
    # init 6

NIS Client

Use these steps to remove NIS from a client

  1. Login the NIS client as root
  2. Remove the NIS domainname file:
    # rm /etc/defaultdomain
  3. Copy the name servers .files into place:
    # cp /etc/nsswitch.files /etc/nsswitch.conf
    If you have DNS services, edit the hosts entry in the /etc/nsswitch.conf file to read:
    hosts: files dns
  4. Change directory to the NIS repository:
    # cd /var/yp
  5. Remove the NIS binding file
    # rm binding
  6. Reboot the server
    # init 6