Wednesday, February 19, 2020

Change OSX Hostname - For Real!

This was enough of a headache today that I wanted to keep a record.

If the hostname of your MacBook doesn't match across various places (Terminal, System Preferences, iCloud) - you can fix it with the steps in this Ask Different question.

I've also included the answer here, for my own sanity.

  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 myMac.domain.com
    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. 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.

No comments:

Post a Comment