This task changes a workstation's domain name. Since a workstation's domain name is usually set during installation, you should check it (type domainname without an argument) before you decide to perform this task.
You must perform this task as superuser on the workstation whose domain name you are changing.
The workstation's superuser password
The new domain name
Log in to the workstation and become superuser.
The examples in this task use client1 as the workstation and doc.com. as the new domain name.
client1% su Password: |
Change the workstation's domain name.
Type the new name after the domainname command. Do not use a trailing dot. For example, to change a workstation's domain to the doc.com domain, you enter:
client1# domainname doc.com |
If the workstation was an NIS client, it may no longer be able to get NIS service.
Verify the result.
Run the domainname command again, this time without an argument, to display the server's current domain.
client1# domainname doc.com |
Save the new domain name.
Redirect the output of the domainname command into the /etc/defaultdomain file.
client1# domainname > /etc/defaultdomain |
At a convenient time, reboot the workstation.
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 workstation.
Because you may be performing this task in a sequence of many other tasks, examine the work remaining to be done on the workstation before rebooting. Otherwise, you might find yourself rebooting several times instead of just once.