From LedHed's Wiki
Contents
Overview
How to change the hostname of a Mac
Command Line
sudo scutil --set HostName [NewHostNameHere]
GUI
Go to: 'System Preferences', 'Sharing'
Reference
https://www.howtogeek.com/tips/how-to-change-your-computer-name-on-mac-os-x/