Saturday, March 27, 2010

How to change the hostname of your Mac

When you first bought your Mac, you may have been in a rush to set it up and named your Mac something you wish you could change. Well, it is not so difficult to do, you just need access to the terminal application and run a few commands.

Three commands are required to change your hostname.

So start by launching the Terminal application located in the Utilities folder of your Applications.

To set the display name of your Mac (in my case MacBook Pro) in the command prompt, type the following command:
macbook-pro:~ mactimes$ sudo scutil --set ComputerName "MacBook Pro"
To set the host name of your Mac (in my case macbook-pro) in the command prompt, type the following command:
macbook-pro:~ mactimes$ sudo scutil --set HostName "macbook-pro"
macbook-pro:~ mactimes$ sudo scutil --set LocalHostName "macbook-pro"
Thereafter, if you wish to view the names configured, use the following commands:

To view the diplay name of our Mac (in my case MacBook Pro) in the command prompt, type the following command:
macbook-pro:~ mactimes$ sudo scutil --get ComputerName
MacBook Pro
To view the diplay name of our Mac (in my case MacBook Pro) in the command prompt, type the following command:
macbook-pro:~ mactimes$ sudo scutil --get HostName
macbook-pro
macbook-pro:~ mactimes$ sudo scutil --get LocalHostName
macbook-pro

2 comments:

  1. Thank you this post was helpful.

    ReplyDelete
  2. Your article very well and good, bringing inspiration to many. I hope people visit my website.
    Friv 11 | K7x |A10 Online |Firv |Yoob 5 .

    ReplyDelete