Adding a record to you hosts file in OS X Leopard

Updating a hosts file on a mac in OS X Leopard is a little more difficult than a PC.http://www.apple.com/downloads/macosx/internet_utilities/hostal.htmlIt is possible to edit the hosts file direct but it is a bit techie on OS X. You need to do EXACTLY the followingYou must have access to log in as the root user - http://support.apple.com/kb/HT1528?viewlocale=en_US

  1. Open Applications > utility > Command ( this is the command prompt for the underlying unix of os x)
  2. Type: su -
  3. Press Return
  4. provide your administrator password
  5. Type the following
    1. cd /etc
    2. vi hosts
    3. i (press the letter i)
    4. use down arrow to get to the last entry in the file
    5. right arrow to get to end of row
    6. press return
    7. type ip tab webaddress you want adding eg.
      1.  78.136.0.162      www.livelinknewmedia.com (there is a tab between the 162 and www)
    8. Press escape
    9. Type :x
    10. You have edited the file now
  6.  You must flush your dns by typing
  7. sudo dscacheutil –flushcache
  8. Done – you should be able to see the site you added now.

 


Your rating: None