Skip to content

Instantly share code, notes, and snippets.

@stovak
Created February 1, 2013 03:24
Show Gist options
  • Save stovak/4688918 to your computer and use it in GitHub Desktop.
Save stovak/4688918 to your computer and use it in GitHub Desktop.
The file /etc/hosts controls the "known" hosts to your mac. You can hijack a website and tell it to use a specific server by defining a websites IP address in your /etc/hosts.
Open a terminal session on your mac and type:
`sudo nano /etc/hosts`
Hit the down arrow until you get to the end of the file.
Entries in /etc/hosts take the following syntax
`<IP Address>[space]<hostname>`
for example:
`192.168.2.33 myintranetserver.mydomain.com`
If you're on a windows machine, you need to put a couple of extra returns in the /etc/hosts file because windows will not read whatever's on the last line. The correct Entries are as follows:
`107.23.204.16 apigee.com`
`107.23.204.16 blog.apigee.com`
Exit nano by hitting <control>-x and saving the file.
then flush the cache:
`sudo dscacheutil -flushcache`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment