Rename a Joined Computer in AD Bridge
To rename a joined computer, you must:
- Leave the domain.
- Rename the computer using the domain join command-line interface.
- Rejoin the computer to the domain.
Do not change the name of a Linux or Unix computer using the hostname command because some distributions do not permanently apply the changes.
The following procedure removes a Unix or Linux computer from the domain, renames the computer, and then rejoins it to the domain.
Renaming a joined computer requires the user name and password of a user with privileges to join a computer to a domain.
- With root privileges, at the shell prompt of a Unix computer, execute the following command:
- To rename the computer in /etc/hosts, execute the following command, replacing computerName with the new name of the computer:
- To rejoin the renamed computer to the domain, execute the following command at the shell prompt, replacing DomainName with the name of the domain that you want to join and UserName with the user name of a user who has privileges to join a domain:
- After you change the hostname of a computer, you must also change the name in the AD Bridge Enterprise local provider database so that the local AD Bridge Enterprise accounts use the correct prefix. Execute the following command as root, replacing hostName with the name that you want:
/opt/pbis/bin/domainjoin-cli setname computerName
/opt/pbis/bin/domainjoin-cli setname RHEL44ID
/opt/pbis/bin/domainjoin-cli join DomainName UserName
/opt/pbis/bin/domainjoin-cli join example.com Administrator
It may take a few moments before the computer is joined to the domain.
/opt/pbis/bin/lsa set-machine-name hostName