Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.12 KB

set_hostname_permanently.md

File metadata and controls

45 lines (34 loc) · 1.12 KB

Set hostname Permanently

Decide on a good hostname and then follow this guide:

  1. Open a terminal.

  2. Type the following command to change the primary hostname of your Mac: This is your fully qualified hostname, for example myMac.domain.com

sudo scutil --set HostName

scutil --set HostName hal9000
  1. Type the following command to change the Bonjour hostname of your Mac: This is the name usable on the local network, for example myMac.local.

sudo scutil --set LocalHostName

scutil --set LocalHostName hal9000
  1. If you also want to change the computer name, type the following command: This is the user-friendly computer name you see in Finder, for example myMac.

sudo scutil --set ComputerName

scutil --set ComputerName hal9000
  1. Flush the DNS cache by typing:

dscacheutil -flushcache

  1. Restart your Mac.

Done

Resources and References