Solaris Troubleshooting NIS : Removing a NIS slave server (or convert it to a NIS client)

Changing an NIS slave server to a client is a three-part process:

1. Edit the ypservers map on your NIS master, removing the defunct slave from the list of servers.

2. on the NIS slave, remove NIS configuration

3. Convert the NIS slave as NIS client

**Note: Step 3 is optional and should be used only if we want turn the NIS slave into NIS client.

Step 1:

Removing NIS Slave from NIS Master’s ypservers map. When you initialize your NIS master, you give it a list of NIS slaves. If you later add additional NIS slaves, or remove one of these original NIS slaves, you must update the NIS list of servers. This is done entirely from the NIS master server. First, you must output the list of NIS servers:

nis_master# cd /var/yp/`domainname`

nis_master# makedbm -u ypservers > /tmp/ypservers

nis_master# vi /tmp/ypservers    and remove  slave from the list.

nis_master# makedbm /tmp/ypservers ypservers

verify removal via:

nis_master# ypcat -k ypservers

The slave server should no longer show up on this list. It is not necessary to reboot the master.  This change will take effect without stopping or restarting any processes.



Step 2:

To remove NIS from a Slave remove the NIS files, as follows:

nis_slave# rm -r /var/yp/`domainname`

nis_slave# rm -r /var/yp/binding/`domainname`/ypservers

nis_slave# rm /etc/defaultdomain

nis_slave# cp /etc/nsswitch.files /etc/nsswitch.conf

Afterwards, reboot the machine.

Step 3:

Converting an NIS slave to an NIS client.

nis_slave# rm -r /var/yp/`domainname`

nis_slave# rm -r /var/yp/binding/`domainname`/ypservers

**Note:  It is necessary to remove the ypservers file because the next step, ypinit -c autopopulates from this file and will add the existing slave as a NIS server when performing that step.**

The normal method for starting NIS under Solaris, is to give it a list of yp servers.  They may be supplied by simply running ypinit, answering the questions, and then rebooting the machine:

nis_slave# ypinit -c

After running ypinit -c, reboot the system and it will come back up as a client and bind to the server name provided in the ypinit -c step.



I have started ( aka in 2009 as my own personal reference blog, and later sometime i have realized that my leanings might be helpful for other unixadmins if I manage my knowledge-base in more user friendly format. And the result is today's' You can connect me at -

You may also like...

1 Response

  1. September 16, 2015

    […] Read – Removing a NIS slave server (or convert it to a NIS client) […]

What is in your mind, about this post ? Leave a Reply

  Our next learning article is ready, subscribe it in your email

What is your Learning Goal for Next Six Months ? Talk to us