How to Set Global Preferences for a Subnet
To assign server preferences in the global table for all the machines on a subnet:
#nisprefadm -G -a -C subnet servers (preferences) |
Where:
-C subnet identifies the IP number of the subnet the preferences will apply to.
servers(preferences) are one or more servers with optional preference ranking numbers.
For example, to specify that the subnet 123.123.123.123 use the nismaster and replica3 servers with default preference number s of zero and the manf.replica6 server with a preference number of 1:
polaris# nisprefadm -a -G -C 123.123.123.123 nismaster1 \ replica3 "manf.replica6(1)" |
How to Set Global Preferences for an Individual Machine
#nisprefadm -G -a -C machine servers (preferences) |
Where:
-C machine identifies the machine the preferences will apply to. (Depending on the shell you are using, you may need to enclose machine in quotes.)
servers(preferences) are one or more servers with optional preference ranking numbers.
For example, to replace the current preferences for the machine cygnus with replica7 and replica9 both with a default preference number of zero:
polaris# nisprefadm -u -G -C cygnus replica7 replica9 |
How to Set Global Preferences for a Remote Domain
To assign server preferences for an individual machine in a remote domain or all the machines on a subnet in a remote domain:
#nisprefadm -a -G -C name \ -d domain servers(preferences) |
Where:
name is the IP number of a subnet or the name of a machine. The modifications you make with this command apply to the subnet or machine that you name.
domainname is the name of the remote domain.
servers(preferences) are one or more servers with optional preference ranking numbers.
For example, to add the nismaster2 server with a default preference number of zero to the preferred server list of the 111.11.111.11 subnet in the remote sales.doc.com domain:
polaris# nisprefadm -a -G -C 111.11.111.11 -d sales.doc.com. nismaster2 |
Specifying Local Server Preference
These procedures explain how to create or change a local client_info file that specifies server preferences for the machine on which it resides.
If a machine has a local /var/nis/client_info file, that machine takes its server preferences from its local file rather than the global client_info tables on NIS+ servers. In other words, a local file overrides any global table.
See "Specifying Global Server Preferences" for information on how to create a global client_info tables for NIS+ servers.
See "Global Table or Local File" for an explanation of the difference between a global client_info table and a local client_info file.
To assign server preferences, run nisprefadm with either the:
-a option to add new or additional preferred servers.
-u option to delete existing server preferences and create new ones.
How to Set Preferences on a Local Machine
To assign server preferences for the local machine that you are running the nisprefadm command on:
#nisprefadm -a -L servers(preferences) |
Where servers(preferences) are one or more servers with optional preference ranking numbers.
For example, to specify that the deneb machine first seek NIS+ information from the replica3 server with a default preference number of zero and then from the replica6 server (with a preference number of 1) in the manf.doc.com domain:
deneb# nisprefadm -a -L replica3 replica6.manf(1) |
Modifying Server Preferences
You can change a server's preference number and switch (replace) the preference numbers assigned to different servers.
To change preferred servers or the preference number assigned to a server, run nisprefadm with the -m oldserver-=newserver(n) option.
How to Change a Server's Preference Number
#nisprefadm -L|-G -C name -m oldserver=newserver(n) |
Where:
-L|-G determines whether you are modifying a local file or a global table.
-C name is the IP number of a subnet or the name of a machine. This option is only used 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.
old server is the name of the server whose preference number you want to change.
new server(n) is the server name and its new preference number.
For example, on the deneb machine, to change the number given to the replica6.manf server to 2 in deneb's local client_info file:
deneb# nisprefadm -L -m replica6.manf=replica6.manf(2) |