The hosts file is used by your local computer’s operating system to resolve hosts names to IP addresses. It is a plain text file and is usually named hosts.
This file is really useful when you have just moved a website to a new hosts as you may want to know how your site works on the new server at the first time so you can troubleshoot any problem or error on your website before going live and update the DNS name servers or a records for your domain.
How to use the hosts file is pretty simple, let’s say we have the DNS named clickittech.com and you want it to point to the IP address 10.10.10.1, you have to look for the hosts file on you operating system (see instructions below) and add a line with the next format:
And then just save the configuration on the file, once this is done, now we have to open a browser and type the domain in it, and you will be pointed to the IP specified on the hosts file, to see how the site is behaving in this new server, if you want to stop resolving to the new IP you only have to erase or comment the line added.
Linux and MAC OS:
Or You can use this MAC tool: Gas Mask It allows you to easily edit the hosts file.
In order for the hosts file settings to take effect, please restart the browser. You can now access your website hosted using the domain name.
As we can see in this blog, using the hosts file is a secure and easy way to test our migrations and troubleshoot any possible problem, here at ClickIT we implement this practices to migrate our sites in the cloud, combining high security, scalability, and redundancy. ClickiT aims to provide secure and high-quality service for the satisfaction and comfort of our clients. Our Agile Team also includes leading IT experts in application migration in the cloud, web security, web development, IT automation, clustering, scalability and near-shore support. Contact Us Now!