scutil
Manage system configuration parameters. tldr-pages
On macOS
macOS
Display DNS Configuration
scutil --dnsIdentifyDisplay proxy configuration
scutil --proxyIdentifyGet computer name
scutil --get ComputerNameIdentifySet computer name
sudo scutil --set ComputerName computer_nameIdentifyGet hostname
scutil --get HostNameIdentifySet hostname
scutil --set HostName hostnameIdentify