OSX BonjourName HostName LocalHostName NetBIOS Name – making sense of it all

DEFINITIONS:
ComputerName = The computer name as visible in the OSX GUI (System Preferences / Sharing …)  Also known as the AppleTalk name, and is used by Finder’s Network Browser.
LocalHostName = The name for bonjour services in the local network.  Sometimes referred to as the BonjourName
HostName = displayed in the command prompt (terminal).
NetBIOS Name = Name as broadcast for Windows network services
ActiveDirectory object name = object created is using ActiveDirectory

Notes:
LOCAL HOST NAME = BONJOUR NAME
**Requires a suffix of .local to be valid.


1
2
3
4
echo "COMPUTER NAME  : " `scutil --get ComputerName`
echo "HOST NAME      : " `scutil --get HostName`
echo "LOCAL HOST NAME: " `scutil --get LocalHostName`
echo "NetBIOS NAME   : " `defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName`

Alternatives:
Hostname:  hostname -f


Sources:

ss64.com
Technical Notes
Tech Otaku
Mr. Macintosh
Apple.com Forum
JamF