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:
10.10.10.1 clickittech.com www.clickittech.com
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.
Restart Browser
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!
Have you ever wondered how businesses easily process enormous volumes of data, derive valuable insights,…
Discover the steps for developing cloud applications, from costs to cloud app deployment
Imagine launching your product with just the core features, getting honest user feedback, and then…
When a tight deadline is non-negotiable, every second counts! Here’s how we developed and launched…
You may have considered hiring a nearshore software development company or services, but you still have doubts…
End-to-end project management goes as far back as you can remember. Every project in history, even…