By adding the corresponding records to you local hosts file you can check how your website looks on the new server before switching the nameservers or during the DNS propagation. Once the records are added, you will be able to check your website by typing its name in the browser.
We recommend closing the browser before performing the changes to the file.
To edit the 'hosts' file in different operating systems, you need to perform the following steps:
If you use Windows 10:
-
In the Search Window type in notepad > right-click on the Notepad icon > select Run as administrator:
Notepad window will open.
-
In Notepad, press the Ctrl + O keymatch > navigate to the C:\Windows\System32\drivers\etc\ directory > open hosts file:
NOTE: If you cannot see the hosts file, select All Files (.) in the dialog box:
-
Add the following entries at the end of the file:
IP_address domainname.com
IP_address www.domainname.comwhere IP_address is the IP address of your account on the server (it can be found in Your Hosting Welcome Guide), and domainname.com is your actual domain name:
-
Press Ctrl + S to save the changes.
If you use Mac OS:
-
Open Terminal.app, either by start typing Terminal on the Spotlight, or by going into Applications > Utilities > Terminal:
-
Open the hosts by typing on the Terminal that you have just opened:
sudo nano /private/etc/hosts -
Type your user password when prompted (you can navigate the file using the arrow keys).
-
Edit the hosts file appending your new mappings underneath the default ones:
IP_address domainname.com
IP_address www.domainname.comwhere IP_address is the IP address of your account on the server (it can be found in Your Hosting Welcome Guide), anddomainname.com is your actual domain name:
-
Save the hosts file (when done editing the hosts file, press CTRL+O to save the file > press Enter on the filename prompt > Ctrl+X to exit the editor).
-
Flush the DNS cache (you can issue a simple Terminal command to flush the DNS cache depending on the version of OS X you are using and have your host file changes to take immediate effect).
NOTE: To revert the changes, you need to remove the new entries added to your host file or simply comment them by adding '#' at the beginning of each line, then save the changes. You may need to clear your browser cache once again to ensure everything is fresh.
If you use Linux:
-
Type the following command in Terminal:
sudo nano /etc/hostsNOTE: You will be prompted to enter your admin password.
-
Navigate to the bottom of the file by using the arrow keys and add the following lines:
IP_address domainname.com
IP_address www.domainname.comwhere IP_address is the IP address of your account on the server (it can be found in Your Hosting Welcome Guide), and domainname.com is your actual domain name:
-
Press the Ctrl+X keymatch, then press the y key and Enter.