Viewable by the world

Purpose of knowledge article

  • Discuss the differences between the 3 types of names that a macOS has: ComputerName, LocalHostname, and HostName
  • Provide instructions on how to view each type of name
  • Provide instruction on how to change each type of name

Resolution

ComputerName

  • To see the ComputerName:
    • On the menu bar, click the Apple icon >>> System Preferences or System Settings >>> Sharing >>> Computer Name
    • In the Terminal application, run the command hostname
    • In the Terminal application, run the command sudo scutil --get ComputerName
  • To change the ComputerName:
    • On the menu bar, click the Apple icon >>> System Preferences or System Settings >>> Sharing >>> Computer Name
    • In the Terminal application, run sudo scutil --set ComputerName "newname"
  • User-friendly name for Mac computers
  • Use for identifying Apple computers on the local network

LocalHostName (Local Hostname)

  • Usually is the same as ComputerName with .local added at the end
  • To see the LocalHostname:
    • On the menu bar, click the Apple icon >>>  System Preferences or System Settings >>> Sharing >>> Edit >>> Local Hostname
    • In the Terminal application, run the command hostname 
    • In the Terminal application, run the command sudo scutil --get LocalHostName
  • To change the LocalHostName:
    • On the menu bar, click the Apple icon >>>  System Preferences or System Settings >>> Sharing >>> Edit >>> Local Hostname
    • In the Terminal application, run sudo scutil --set LocalHostName "newname"
  • Another name is local network name
  • Use for identifying Apple computers on the local network 
  • Use by Bonjour-compatible services

HostName

  • To see the Hostname:
    • In the Terminal application, run the command sudo scutil --get HostName
  • To change the HostName:
    • In the Terminal application, run sudo scutil --set HostName "newname"
  • The HostName is provided by the DHCP server that the Apple computer connects to
  • Typically not set by the user and best not to set it
  • Use by outside the local network (external network/Internet) to identify Apple computers

Additional Resouces