Frequently Asked Questions

« Previous
How do I send mail from a shell script in Linux and macOS?
Next »
How do I create binary packages with MacPorts?

windows ubuntu macos xibo network zenworks android storage

108. How do I change the Mac computer name, host name and NetBIOS-name?

See also: What is my computer name in Windows?
See also: How do I find the serial number on macOS?
See also:
See also: How do I install anti-virus software on macOS?

In macOS, change the computer names in the system settings, in the Share (Delning) dialog.

The university name standard begins with an identifier for each department and then a dash and a unique identifier. At BMC-IT and the departments we support we continue with the computer serial number like this:

  1. Begin with a TLA - the three letter acronym (Neuroscience - INV, Medical Biochemistry and Microbiology - IMB, Pharmaceutical biosciences - FBV, Medical Cell Biology - MCB, Uppsala Biomedical Centre - BMC, Public Health and Caring Sciences - IFV, etc)
  2. Then a dash -.
  3. Then the serial number max 11 characters (cut away the leading ones to keep the usually significant ones)
  4. The full computer name should be 15 characters or less (to not generate possible problems in old network sharing protocols like WINS... In a couple of years, when WINS is totally gone, then this rule most probably can be ignored)

The host name is however picked up from the DHCP-server. It is used as a prompt in the command line. With dynamic DHCP the IP and the host name may change from time to time. So to get a consistent hostname set it manually like this; in this example BMC-COVFEFE is used as hostname, but please use your own instead!

The terminal may look like this:

$ scutil --get HostName HostName: not set $ sudo scutil --set HostName BMC-COVFEFE Password: $ sudo scutil --set ComputerName BMC-COVFEFE $ sudo scutil --set LocalHostName BMC-COVFEFE $ scutil --get HostName BMC-COVFEFE $ scutil --get ComputerName BMC-COVFEFE $ scutil --get LocalHostName BMC-COVFEFE $ _

Also check and set the NetBIOS-name. It may or may not be the same as the computer name and host name. The default is the same as the hostname but if this has been changed before it may be something else. Change it like this:

The NetBIOS-name can be changed in the terminal as well like this:

$ sudo defaults write /Library/Preferences/SystemConfiguration/ NetBIOSName BMC-COVFEFE $ defaults read /Library/Preferences/SystemConfiguration/ NetBIOSName BMC-COVFEFE $ _


This entry mac.computername was last modified 2018-06-04


This documentation is covered by GNU Free Documentation License. 12 ms