Mac shows the username, profile pictures and prompt a password whenever you login to your computer. This username is shown in most of the places and Mac will also create home directory from the admin username. Besides this username your Mac will have a computer name which will be used for many purposes. In this article let us explain how to change the computer name of your Mac.
Where My Computer Name is Shown?
Your computer name will be shown to anyone try to find on you on the network. This is a local hostname for identifying your computer on your network. For example, if you have enabled device tracking with Find iPhone app on your iPhone then it will show the computer name of your Mac.
Here are some places you can Mac displays the computer name:
- All places on the network like Find iPhone.
- Apple’s Bonjour networking apps.
- During all types of sharing like screen / file / internet / Bluetooth / printer sharing.
- Remote login and remote management of Mac.
- On the default screen saver.
- Command line of the Terminal app.
Where to Find the Computer Name?
Click on the ‘Apple Menu’ and go to ‘System Preferences…’ section. Look for ‘Sharing’ option and click on it.
Here you will find the computer name of your Mac. In our example, the computer name is ‘MacBook-Pro’.
How to Change Computer Name of Mac?
By default the Mac will disable the ‘Edit’ button from someone changing the name of your computer. If you want to change the computer name of your Mac then click on the lock icon on the bottom showing ‘Click the lock to make changes’.
Now, you will be prompted to enter the administrator password. So remember to login with your administrator account before trying to edit the computer name. You can’t change the computer name from the standard or parental control account. Enter your administrator password.
Now that you can see the ‘Edit’ button is enabled and click on it.
You will see the computer name is showing against ‘Local Hostname’.
Change the name to any name you prefer, for example, change to ‘My-MackBook-Pro’.
- The computer name will include .local extension to indicate the name is a local network name.
- Any in-between space will be converted to hyphen.
- Computer name is NOT case sensitive, so you can use both capital and small letters.
- In case if there is a computer on your network already has the same name then Mac will automatically add number suffix to the name to differentiate.
Dynamic Global Hostname
As mentioned above, the purpose of computer name is to identify your Mac within the local network like house or office network. But you can also assign a global hostname so that anyone can locate your Mac outside your network. This needs the support from your internet service provider to assign a DNS hostname.
- Click on the ‘Use dynamic global hostname’ option.
- Enter the hostname, user and password. You should get these details from your internet service provider.
- Whenever IP address changes, your Mac will dynamically assign the hostname.
Select the option ‘Advertise services in this domain using Bonjour’ to advertise your Mac’s services on Bonjour supported domain. Other computers can find your services listed in their apps when Bonjour browsing is enabled for the hostname you are using.
Change Computer Name from Terminal
well, it is very simple to change the name from Sharing preferences as explained above. Alternatively you can also try changing the name from Terminal command prompt.
- Press ‘command + spacebar’ and open Spotlight Search.
- Search for ‘terminal’ and open Terminal app.
- Enter the below command and hit enter key.
sudo scutil --set HostName NEW-MAC-NAME sudo scutil --set LocalHostName NEW-MAC-NAME sudo scutil --set ComputerName NEW-MAC-NAME
All these three parameters hostname, localhostname and computer name are used in similar context.
- Hostname is the normal hostname for your computer.
- Computer name is the user friendly name of your computer.
- Local hostname is the Bonjour hostname used in Apple’s Bonjour network.
- Remember to copy and paste this command on a TextEdit document and change the NEW-MAC-NAME to your new computer name. Then copy that code with the correct computer name and paste on Terminal app.
- You will be prompted to enter admin password. Enter your admin password and hit enter.
- Quit terminal app and reopen to see the computer name is changed. You can also verify the new name in Sharing preferences.
If you see the new name is not effective then try entering the below command to flush your DNS entries.
Finally click on ‘Apple menu’ and choose ‘Restart…’ to reboot your computer. Now you should see the new computer name fo your Mac.