How to change your hosts file in OS X Leopard

Friday, September 19, 2008 03:40 AM

Just follow these few easy steps...

  1. Open Finder and goto Applications -> Utilities -> Terminal.
  2. Type sudo nano -w /etc/hosts and when prompted enter your Administrator password.
  3. This is where you add/edit your hostname/ip address pairs you want to add. Remember to save the changes you make!
  4. Type dscacheutil -flushcache.
  5. You might want to test your changes by pinging the hostnames you added in step 4 (i.e. Type ping yourdomainnamehere.com).