Set the hostname/computer name for macOS I have a local network at home. This network contains 5 laptops. One of the laptops is a Mac with macOS 10.8 on it. The other has a Linux installed, all others run Windows.
When trying to open my router and check &quot;Connected devices&quot;, under the IP address of this Mac I see following:
Host Name - some IPV6 address
What I'd rather prefer to see is some meaningful name so that I can use that in the /etc/hosts file in Linux laptop. And also I'd like to check the computer name so that the /etc/hosts line was proper.
Setting the Mac hostname or computer name from the terminal


  
  Open a terminal. 
  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 &lt;new host name&gt;

  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 &lt;new host name&gt;

  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 &lt;new name&gt;

  Flush the DNS cache by typing: 

dscacheutil -flushcache

  Restart your Mac.