When we initialized a master server or client, we were prompted to enter our list of servers. This information is used to generate another NIS map, named ypservers, which we can view using ypcat or makedbm, just as we would with any other map.
It's actually quite common updating this map. For example, many sites prefer to order the list of servers by their location and so they need to edit the map on a regular basis as servers are relocated.
Unfortunately, there are only two ways to do this. The first is using ypinit when a machine is initialized as we saw earlier. The second is to perform the updates manually.
Here, we'll look at the steps that need to be followed should you decide to do the latter. First we'll take a look at the entries that may be already in there:
tin# ypcat -k ypservers tin fluorine iodine tin#
To edit the map we first need to convert it to a temporary ASCII file:
tin# cd /var/yp/nis.solarisbootcamp.com tin# makedbm -u ./ypservers > /tmp/newServers tin#
Now we can edit the file to add or remove any servers as required:
tin# cat /tmp/newServers YP_LAST_MODIFIED 0996667575 YP_MASTER_NAME tin tin fluorine iodine new_server_to_add tin#
We've added a new server (called “new_server_to_add”) to the end of the file. When everything is correct we can rebuild the map:
tin# makedbm /tmp/newServers ypservers tin#
Lastly, we can check the file to make sure everything is OK:
tin# ypcat -k ypservers tin fluorine iodine new_server_to_add tin#