From time to time it is necessary to update the hosts file on a machine, and MAC’s are no different! given they are based on unix most bits and pieces are in their usual places but “hidden” from the usual users. With good cause! If your reading this your obviously not a normal user…
So lets begin.
- Open Terminal and gain elevated privileges
Click on Applications >> Utilities >> Terminal then enter the below command to gain elevated privileges.
- Enter and edit the hosts file as below.
Enter the below command to edit the hosts file
- Once done save!
Once you’ve finished editing the file as required hold Control and hit O then Enter, then Control and hit X to exit, and you’re done! Exit Terminal.
Job done! It isn’t difficult, however you need to use the sudo su command to gain root privileges before you will be able to successfully save the hosts file. For more information on Hosts Files check out this wiki link.