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.

Rename a Computer Using the Command-Line Tool

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.

  1. With root privileges, at the shell prompt of a Unix computer, execute the following command:
  2. /opt/pbis/bin/domainjoin-cli leave
  3. To rename the computer in /etc/hosts, execute the following command, replacing computerName with the new name of the computer:
  4. /opt/pbis/bin/domainjoin-cli setname computerName
    /opt/pbis/bin/domainjoin-cli setname RHEL44ID
  5. 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:
  6. /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.

  7. After you change the hostname of a computer, you must also change the name in the AD Bridge local provider database so that the local AD Bridge accounts use the correct prefix. Execute the following command as root, replacing hostName with the name that you want:
  8. /opt/pbis/bin/lsa set-machine-name hostName