System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)

Changing a Machine's NIS Domain

To change the NIS domain name of a machine, do the following.

How to Change a Machine's NIS Domain Name
  1. Become superuser.

  2. Edit the machine's /etc/defaultdomain file, exchanging its present contents with the new domain name for the machine.

    For example, if the current domain name is sales.doc.com, you might change it to research.doc.com.

  3. Run domainname `cat /etc/defaultdomain'

  4. Set the machine up as an NIS client, slave, or master server.

    See for Chapter 8, Setting Up and Configuring NIS Service for details.