DotResults - Quick Tech Answers

How to Edit the Hosts File Mac OS X Snow Leopard

by Kayla on October 27, 2009

Do you need a free shell account?
Then sign up at Devio.us!
You’ll get unrestricted shell access via SSH and access to all standard software – compilers, IRC clients, mail clients, screen, etc. Check out the details at http://devio.us/services

There are times during DNS changes or other testing that you may want to specify a particular IP for a domain name. To do this, you’ll need to edit your hosts file. This way you can “trick” your computer before DNS actually changes or point a domain to another IP, even a local one. Some of the instructions out there on how to do this are a little too bloated, so I tried to simplify them as much as possible here on DotResults. If you have any questions about this, please leave a comment and we’ll get back to you as soon as we read it.


1. Open Terminal

2. Paste this command:
sudo nano /private/etc/hosts
You’ll be asked to enter your administrator password.

3. Arrow down to the last line, highlighted here, and type your entry like this: 137.61.27.216 www.tech.com

4. Press control+x. Type the letter Y. This saves the file.

5. To flush your DNS cache so the changes take effect, paste this command next:
dscacheutil -flushcache

6. You can test if it has worked by using the PING command. Try PING tech.com and PING www.tech.com – the IP addresses should be different.


  • Share/Bookmark

{ 1 trackback }

Tweets that mention How to Edit the Hosts File Mac OS X Snow Leopard -- Topsy.com
October 28, 2009 at 7:05 am

{ 0 comments… add one now }

Leave a Comment

Previous post: Best Website Design Tips – Our Top 5

Next post: How to Install Putty on OS X

  • Free UNIX Shell Account
  • Tags

    birdcage blog hosting services brand new cell phones chili cisco class computing cooking cryptographic software device facebook fonts gadget good idea googles handwriting handwriting font identify internet kindles mac macports online social networking openbsd orlando osx peek perl phone bill php programming language putty reason scanning scanning imaging social media spicy ssh system software terminal twitter UNIX web 2.0 wordpress world wide web

2010 DotResults. All rights reserved. Powered by Selans

Get smarter with the Thesis Theme for WordPress