Showing posts with label scutil. Show all posts
Showing posts with label scutil. Show all posts

Monday, May 13, 2013

Change Mac hostname from Terminal

Sometimes I have found that changing the Mac's hostname from System Preferences/Sharing doesn't do the job.  In these cases it is best to change the hostname from Terminal:

sudo scutil --set HostName [new hostname]

Example: sudo scutil --set HostName LDNMAC-1234


Saturday, July 23, 2011

scutil to change host names

Apparently "changeip" isn't the recommended way to change DNS names in Snow Leopard so we must use "scutil" instead.

Take a look at the man page but mostly we will problem use it to change computer and host names:

sudo scutil --set ComputerName [new name]
sudo scutil --set HostName [new name]


 --set pref [newval]
       Updates the specified preference with the new value. 
       If the new value is not specified on the command 
       line then it will be read from standard input.

         Supported preferences include: 
         ComputerName LocalHostName HostName

         The --set option requires super-user access.

     --dns
         Reports the current DNS configuration.