Sunday, 26 September 2010

MAC how to change hostname on command line via Terminal

To change your Mac's Fully Qualified Hostname open a terminal window, and become superuser

su ( then type your su admin password)

or

sudo the command below

First type 'hostname'
your hostname will look something like

sh-3.2# hostname
mymac.local

To change this to your desired dns domain name
type

scutil --set HostName mymac.mynewdomain.co.uk

or
sudo scutil --set HostName mymac.mynewdomain.co.uk ( if you havent already become su)

Then type 'hostname' again to check the change

sh-3.2# hostname
mymac.mynewdomain.co.uk

0 comments: