How To Edit Hosts File
Written by:
Will Kruss
on
09 March 2017 01:49 PM
|
|
On occasion you will need to edit the hosts file on your machine. VPSBlocks provides details on how to edit hosts file. If you want to make your local computer believe that your website is hosted on your new VPS before you modify the actual DNS, this can easily be done by modifying your hosts file. Windows
x.x.x.x www.yourdomain.com
Once you have completed any testing always modify your hosts file again and remove the lines you added. MACYou need to edit the file at /private/etc/hosts If you aren't sure how to do this follow these instructions: 1. Open Terminal 2. Type: sudo nano /private/etc/hosts 3. Enter your administrator password when prompted 4. Edit the file in the same format as for Windows above e.g. 5. Press Ctrl-o to save the file 6. Press Enter to confirm saving the file 7. Close all instances of your browser. 8. Reopen your browser and browse to www.yourdomain.com and what you see will be served from your new VPS. Once you have completed any testing always modify your hosts file again and remove the lines you added.
| |
|