Your cart is currently empty!
A hosts file is a plain text file used by many operating systems to map hostnames (such as www.humanextended.com) to IP addresses (such as 63.250.43.134). Today, the vast majority of mapping is performed by the global domain name system (DNS), but the hosts file still exists on Windows as a local override.
The hosts file contains one mapping per line. Each line specifies an IP address, then at least one space, and then the hostname to be mapped to that IP address. Here is an example:
0.0.0.0 ads.example.com
#
# Lines beginning with a hash (#) are ignored.
#
# If an app tries to resolve ads.example.com, it will get 0.0.0.0.
# This is an invalid address, so any connection attempt will fail.
You may wonder why anyone would use a hosts file instead of DNS. A common trick is to put advertising sites in the hosts file, causing the hostnames to resolve to an invalid address.
When an app downloads something from the internet, it typically connects to a host with using a friendly name such as ads.example.com or analytics.example.com. This name needs to be translated to an IP address so that a connection can be made.
Normally this is performed by DNS, which will return the IP address of the server. However, before DNS is checked, Windows checks the hosts file for any local overrides. If the host is mapped to 0.0.0.0, that will get returned to the caller, which will fail to connect. This is because 0.0.0.0 is forbidden as a destination address.
Unfortunately, this approach can be less-than-ideal:
The hosts file is a protected system file. You must open your editor as an administrator in order to modify the file. On Windows, open the Start menu and type Notepad without hitting the enter key. Look for Run as administrator and click it.
If you don’t do this, the hosts file will not be visible. This is because the hosts file does not have a .txt extension.
# A comment is a line that begins with a # (hash) symbol.
# Comments are ignored by Windows.
# You can write comments to explain why you made changes.
# There may be other comments that you should review.
Each entry in the file must be on its own line. You can put the line anywhere.
# Block www.example.com
0.0.0.0 www.example.com
You may also see online guides suggesting that you specify 127.0.0.1 as the IP address. This address is known as the loopback address and is essentially a reference to the same machine. However, using 0.0.0.0 is preferred because it will fail faster.
localhost
, which is a special alias for the local computer. When you connect to localhost, you are connecting to your same computer.You are free to share and adapt this content for any purpose as long as you give appropriate credit in a reasonable manner.
We do not participate in affiliate marketing, and we are not paid to mention products.
Having trouble?
We complete tasks for you. Our goal is to offload your technical labor so you can focus on business and innovation.
$60
per hour
Fixed rate for all types of tasks.
No monthly charges.
Pay by the minute.
Leave a Reply