How to Test Website Using HostFile?

Posted by Sakshita

Test Website Using HostFile

When a user migrate website from one server to another, then IP Address changed  that means the domain will now point to the new IP Address. Many a times it happen, that domain takes time to update DNS settings then in that case user can change the IP Address in the hosts file and force the domain to point to new IP Address.

What is Hosts File?

Hosts File is a special file in the server computer that has information of IP Address and its related domain name. This file contents includes entries for "localhost" and some #comments. 
In this file, each line has IP Address and domain name separated by one or more spaces. This file allows user to test websites as modifying this file will control the IP Address of the domain on your PC.

How to Edit Host File in Windows?

Editing hosts file is not a big task. Get the hosts file in your PC and edit it. Let us see the procedure in detail to edit the host file.
  • You can easily get and edit hosts file in Windows. In Windows, the path of host file is C:\Windows\System32\drivers\etc\hosts
  • To edit this file, first navigate to the file and copy this to My Documents. Open the file with Notepad++ and Edit and then Save.
The syntax to write domain and IP Address to host file is very simple, i.e IP Address and domain name separated by one or more spaces.
00.00.00.0     example.com
00.00.00.0     www.example.com
  • Save the file and then paste the edited file back to the original location.
That's it !
With the above given procedure you can easily test the website using Hosts file. To check the IP Address of any website you may add extensions like Get Website IP to your browser. 

Domain Pricing          Cheap Shared Hosting           Cheap Reseller Hosting              Cheap VPS Hosting              Dedicated Servers

Comments