by Lori Kaufman
on How to geek
See other posts from How to geek
or by Lori Kaufman
Published on Wed, 28 Nov 2012 19:00:15 GMT Indexed on 2012/11/28 23:06 UTC
Read the original article Hit count: 262
The hosts file in Windows contains mappings of IP addresses to host names, like an address book for your computer. Your PC uses IP addresses to find websites, so it needs to translate the host names into IP addresses to access websites.
When you enter a host name in a browser to visit a website, that host name is looked up in DNS servers to find the IP address. If you enter IP addresses and host names for websites you visit often, these websites will load faster, because the hosts file is loaded into memory when Windows start and overrides DNS server queries, creating a shortcut to the sites.
Because the hosts file is checked first, you can also use it to block websites from tracking your activities on the internet, as well as block ads, banners, third-party cookies, and other intrusive elements on webpages. Your computer has its own host address, known as its “localhost” address. The IP address for localhost is 127.0.0.1. To block sites and website elements, you can enter the host name for the unwanted site in the hosts file and associate it with the localhost address. Blocking ads and other undesirable webpage elements, can also speed up the loading of websites. You don’t have to wait for all those items to load.
The default hosts file that comes with Windows does not contain any host name/IP address mappings. You can add mappings manually, such as the IP address 188.8.131.52 for www.google.com. As an example of blocking an ad server website, you can enter the following line in your hosts file to block doubleclick.net from serving you ads.
© How to geek or respective owner