Modifying your hosts file cauxses your local machine to look directly at the Internet Protocol (IP) address that you specify, overriding the domain name system. This can be useful when you’re testing your site without going live, or other DNS related reasons.
For Windows:
1. Type Notepad in the search field. Right click Notepad and Run as administrator
2. Once open, click on the File button at the top and open the following file:
c:\Windows\System32\Drivers\etc\hosts
3. Edit the file
4. Click the File button again and save your changes
For MacOS X: