How to edit hosts file on Mac OSX

Edit this file /private/etc/hosts.

Terminal

$ sudo nano /private/etc/hosts

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost
127.0.0.1       mkyong-mac
198.x.x.x       linode-bot1
1.2.3.4         www.google.com

References

  1. What is the difference between /etc/hosts and /private/etc/hosts
  2. Modify your hosts file
author image

mkyong

Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities. Read all published posts by

Comments

avatar
3000
newest oldest most voted
<a title=\"Domino Kiu Kiu\" href=\"http://www.ArmaniQ
Guest
<a title=\"Domino Kiu Kiu\" href=\"http://www.ArmaniQ

terima kasih banyak untuk artikelnya…. sangat keren gan….