by Barry Dysert
(last updated December 5, 2016)
Your Hosts file (introduced in this tip) is an important system file for network communications, but it can easily be modified just like any other text-based file. Before modifying it, though, it's recommended that you make a backup copy of it just in case something goes wrong. You can make a backup any number of ways, but to keep things simple we'll do everything from within Notepad.
Now make whatever edits you choose to the file, but don't save anything yet. When you've made all the changes you need and you're content with your changes, follow these steps:
Any changes you made to the Hosts file go into effect immediately.
Remember that the primary purpose of the Hosts file is to override what would be found by consulting your regular DNS server. For instance, let's say that you are a Web developer, and your client's current website resolves, through DNS, to an IP address of 188.8.131.52. You are working on a brand new site for the client, and you have that site set up at a different IP address, such as 184.108.40.206. If you modify your Hosts file to point to the IP address of the new site, then DNS is bypassed and all references on your system to the client's website will resolve to the IP address you entered in the Hosts file.
Another possible use for your Hosts file is to deny access to a particular website. Let's say that your company doesn't allow access to a particular website called ObnoxiousSite.com. You can block access to the website by modifying the Hosts file so that ObnoxiousSite.com is associated with the IP address 127.0.0.1. (As an alternative, you could also use the IP address 0.0.0.0.) Once saved, any references to ObnoxiousSite.com will be ignored on your system.
This brings up a helpful troubleshooting point: Some third-party programs may modify your Hosts file automatically, or your company may create custom Hosts files for systems on your network. If you cannot get to a site you need to get to, you may want to check your Hosts file to see if the site is blocked in the file.
This tip (12858) applies to Windows 7, 8, and 10.
Your system's Hosts file is an important file that can be used to increase the speed of you network connections, let you ...Discover More
For security reasons, you may want to scan your system for open ports. This tip explains a bit about ports and how to see ...Discover More
Cookies can be a good thing, but they can also be aggravating. Here's a high-level explanation about a specific type of ...Discover More
FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."