To change one server for another in a preference list:
Run nisprefadm with the -m oldserver=newserver option.
#nisprefadm -L|-G -C name -m \ oldserver=newserver(prefnumber)
-L|-G determine whether you are modifying a local or a domain-wide server list.
-C name is the IP number of a subnet or the name of a machine. This option is only used in when you are also using the -G option. The modifications you make with this command apply to the subnet or machine that you name.
-m is the modify-server-list option.
oldserver is the old server you are replacing.
newserver(prefnumber) is the new server (with an optional preference number) that is taking the old server's place in the preferred server list.
Keep in mind that when you replace a server in a global client_info table using the -G option, the replacement only applies to the subnet or machine identified by the -C option. Other listings of the replaced server are not affected.
For example, suppose you have a domain with three subnets, and the replica1 server is listed as a preferred server for two of those subnets. If replica1 is obsolete and you take it out of service, you then run nisprefadm -m to replace it with the new server for the first subnet. Until you do the same for the second subnet, replica1 is still listed as a preferred server for that subnet. The same principle applies to preferred servers for individual machines.
For example, to replace the replica3 server with the replica6 server for subnet 22.214.171.124 in the domain's global client_info table and assign replica6 a preference number of 1:
nismaster# nisprefadm -G -C 126.96.36.199 -m replica3 replica6(1)