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
Resolution
ComputerName
- The name given to the computer
- To see the ComptueName:
- 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 set 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"
- 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 >>> Loacl Hostname
- In the Terminal application, run the command hostname
- In the Terminal application, run the command sudo scutil --get LocalHostName
- To set the LocalHostName:
- On the menu bar, click the Apple icon >>> System Preferences or System Settings >>> Sharing >>> Edit >>> Loacl 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 set 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