How to use hosts file manipulation
Share buttons:Linux:
Open a terminal and enter the following command (given that you are a sudoer).
sudo vi /etc/hosts
Then press 'i' to enter insert mode and write the configuration according to this template at the bottom of the file:
<IP ADDRESS> <DOMAIN>
NOTE: most times for this to work properly we need to add www.<DOMAIN> as it is a standard of sort.
Windows:
Start Notepad as an admin and open the following file:
c:\Windows\System32\Drivers\etc\hosts
Then write the configuration according to this template at the bottom of the file:
<IP ADDRESS> <DOMAIN>
And save.
NOTE: the <IP ADDRESS> is the servers public IP address, and most times for this to work properly we need to add www.<DOMAIN> as it is a standard of sort.