Change MacOS Computer Name across all components

Here's definitively how to change your system name in MacOS across all components.
These instructions for modern versions, worked perfectly on Sequoia 15.4.1

# Friendly name (shown in Finder/AirDrop)
sudo scutil --set ComputerName "odyssey-redux"

# Hostname (shown in Terminal prompts, network identification)
sudo scutil --set HostName "odyssey-redux"

# Bonjour/local network name (e.g. My-MacBook.local)
sudo scutil --set LocalHostName "odyssey-redux"

# Flush DNS cache to make sure changes stick
dscacheutil -flushcache

More from Mario's Notes
All posts