scutil to fix AD binding issues in OS X

scutil to fix AD binding issues in OS X

Invalid AD HostName Why scutil? It is not unusual to run into the occasional hiccup when binding Macs to an Active Directory domain. Most of the time, these issues are easily fixed by unbinding and then rebinding using the GUI. Occasionally, you will run into an issue where the HostName causes issues. These cases can be easily identified when using the Directory Utility because the Computer ID (a.k.a. HostName) will contain characters or symbols unrecognized by AD. Parentheses seem to be the most common. Changing the HostName in System Preferences->Sharing doesn’t actually fix the issue. Instead, open the Terminal app and follow the steps outlined below using the scutil command.

#2 is what I use most of the time to fix the issue.




Perform the following tasks to change the workstation hostname using the scutil command.

scutil to fix AD bindings

  1. Open a terminal.
  2. Type the following command to change the primary hostname of your Mac:
    This is your fully qualified hostname, for example
    sudo scutil –set HostName <new host name>
  3. Type the following command to change the Bonjour hostname of your Mac:
    This is the name usable on the local network, for example myMac.local.
    sudo scutil –set LocalHostName <new host name>
  4. Optional: If you also want to change the computer name, type the following command:
    This is the user-friendly computer name you see in Finder, for example myMac.
    sudo scutil –set ComputerName <new name>
  5. Flush the DNS cache by typing:
    dscacheutil -flushcache
  6. Restart your Mac.

When you are finished, you should be able to reopen Directory Utility and successfully bind your Mac to Active Directory. Be sure to double check that everything is working in System Preferences -> Users & Groups. Click on Login Options and look for the name of your domain and the green “jelly bean” indicator.

scutil AD binding OSX Apple

Additional Resources

Type scutil –help for the complete list of parameters.

Reference: AutoDesk Knowledge Network

hostname fixed scutil