Here are two instances where I found that setting the computer name via System Preferences > Sharing > Computer Name does not really set the HostName
attribute.
The macOS version is macOS High Sierra version 10.13.6 in both instances below.
Instance 1
I got a brand new MacBook Pro which had the following settings under System Preferences > Sharing.
- Computer Name: Lone's MacBook Pro
- Local Hostname: Lones-MacBook-Pro.local
The scutil
and hostname
output looked like this:
$ scutil --get ComputerName
Lone's MacBook Pro
$ scutil --get LocalHostName
Lones-MacBook-Pro
$ scutil --get HostName
HostName: not set
$ hostname
Lones-MacBook-Pro.local
Then I went to System Preferences > Sharing and set the Computer Name to luke
. Now the output looked like this:
$ scutil --get ComputerName
luke
$ scutil --get LocalHostName
luke
$ scutil --get HostName
HostName: not set
$ hostname
luke.local
The HostName
attribute is not set!
Instance 2
I was working on a friend's MacBook Pro who had some other HostName
already set (perhaps someone else had configured it for him). He had the following settings under System Preferences > Sharing.
- Computer Name: mmod
- Local Hostname: mmod.local
The CLI output looked like this:
$ scutil --get ComputerName
mmod
$ scutil --get LocalHostName
mmod
$ scutil --get HostName
mmod
$ hostname
mmod
Now I went to System Preferences > Sharing and set Computer Name to luke
. The output now is:
$ scutil --get ComputerName
luke
$ scutil --get LocalHostName
luke
$ scutil --get HostName
mmod
$ hostname
mmod
Again, HostName
remains unaffected.
Question
I know that I can set the HostName
attribute with the scutil --set HostName luke
command.
My question is: Is there a macOS desktop UI element where I can view or edit this HostName
attribute without having to run CLI commands?