Proudly Hosting over 100,000 Fast Websites since 2010

How can we help you?

Type your topic or keywords and hit enter to search our knowledgebase.

How to test your website before changing DNS or Nameservers?

The host file can be used to access your website from the server where your website files and database exist but the DNS of the website still doesn’t point to that server. This is useful when you want to preview your website from the server before actually pointing your website’s DNS to that server.

When you use the host files of your local system to access a particular website, your browser skips DNS lookup and directly sends a request to the Server’s IP (mentioned in the host file) to fetch the website’s content.

How to change the host file to access a website before changing DNS/Nameservers?

To use the host file of your local system to access the website from a server, you need to add a single line in the host file. Edit the host file of your local system using your file editor add the entry like below in that file at the end and save it.

192.168.0.1 www.example.com example.com

Here, 192.168.0.1 is the IP of the server from where you want to access your website. So, you need to have the IP of the server. You can find the IP of the server in the welcome email you’ve received from us.

Depending on the OS you have in your local system, you can find the host file at the below locations.

Linux: /etc/hosts

The host file would look like this after adding an entry in the host file of the Linux system:

Document image

 

Windows: C:\Windows\System32\drivers\etc\hosts

The hosts file would look like this after adding an entry in the hosts file of windows system:

Document image

MAC: /etc/private/hosts

The hosts file would look like this after adding an entry in the hosts file of MAC system:

Document image

Updated on October 15, 2024