This post will show how to set the hostname of a mac on the terminal, we will use the tool scutil and dscacheutil to flush the DNS cache.
Provide the sudo password when you are asked for.
Hostname
Hostname is the fully qualified hostname, including the domain, e.g. myMac.tld.com
LocalHostname
LocalHostname is the name of the mac in the local network, e.g. myMac.lan. When needed add the trailing .local or .lan or just omit the extension.
ComputerName
ComputerName is the u…