Want to know how your website would behave on Domain? Hosts file is the answer.

Lesser known but critical file, hosts file, is a simple text file without a file extension is designed to map or override IP addresses before accessing a DNS (domain name server). In simple words, the “hosts” file overrides any request to a DNS server for a domain name resolution, meaning that you can override where your computer connects to by editing this file as you wish. Another benefit of using the hosts file is precedence.If a hosts file exists, it is automatically searched during any process using the OS TCP/IP stack. The search is done first before any attempt to find a DNS server is made.

Lets say your website is deployed on your test server with IP@ and would exist on mysite.com domain well pushed LIVE. So, you must want to see how your website and its pages are behaving when Domain Switching would done on your Production and available to end user. The simple solution is update the hosts file on your local machine with below configuration:        mysite.com

So, once you save the hosts file with this configuration, you can browse the complete website using http://mysite.com on your web browser. Isn’t that Simple & Reliable?

Location of Hosts File

Windows 8, 7, Vista, XP & NT/2000 %SystemRoot%system32driversetc
Mac OS X /private/etc/hosts
iOS, Android, Unix/Linux /etc/hosts

Other hidden benefits of hosts file includes:

  1. Substitute One Domain Name For Another
  2. Blocking Malware or Undesirable Sites
  3. Ad blocking
  4. Speeding Up Browsing



(Visited 119 times, 1 visits today)