Skip to content

Instantly share code, notes, and snippets.

@mttjohnson
Created December 4, 2023 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mttjohnson/1152550255d91423a0c7288ec9ce3469 to your computer and use it in GitHub Desktop.
Save mttjohnson/1152550255d91423a0c7288ec9ce3469 to your computer and use it in GitHub Desktop.
change macos hostname
new_hostname="my-new-hostname"
sudo scutil --set HostName ${new_hostname}
sudo scutil --set LocalHostName ${new_hostname}
sudo scutil --set ComputerName ${new_hostname}
dscacheutil -flushcache
# reboot mac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment