System Administration Guide: Naming and Directory Services (NIS+)

Changing an NIS+ Machine's Domain Name

This task changes a machine's domain name. Since a machine's domain name is usually set during installation, you should check it by typing domainname without an argument before you perform this task.

ProcedureHow to Change an NIS+ Client's Domain Name

Use the domainname command to change the client machine domain

Before You Begin

You must perform this task as superuser on the machine whose domain name you are changing.

Information you need to change a client's domain name:

  1. Log in to the machine and become superuser.

    The examples in this task use client1 as the machine and doc.com. as the new domain name.


    client1% su
    Password:
  2. Change the machine's domain name.

    Type the new name after the domainname command. Do not use a trailing dot. For example, to change a machine's domain to the doc.com domain, you enter:


    client1# domainname doc.com

    If the machine had been an NIS client, it may no longer be able to get NIS service.

  3. Verify the result.

    Run the domainname command again, this time without an argument, to display the server's current domain.


    client1# domainname
    doc.com
  4. Save the new domain name.

    Redirect the output of the domainname command into the /etc/defaultdomain file.


    client1# domainname > /etc/defaultdomain
  5. At a convenient time, reboot the machine.

    Even after entering the new domain name into the /etc/defaultdomain file, some processes may still operate with the old domain name. To ensure that all processes are using the new domain name, reboot the machine.

    Because you may be performing this task in a sequence of many other tasks, examine the work remaining to be done on the machine before rebooting. Otherwise, you might find yourself rebooting several times instead of just once.

    Although restarting individual daemons, such as mountd may solve an NFS problem, it is strongly recommended that you reboot to synchronize configuration changes across daemons. This minimizes application failures caused by unknown changes to the configuration.