
This type of DNS attack is known as DNS pharming, and checking your hosts file can uncover potential infection.


For example, if your hosts file had been unknowingly changed to point your banks domain name to the IP address of a hacker. Blocking is achieved by setting the IP address of the ad networks to a loopback address like 127.0.0.1 which will not return anything.Ĭhecking for compromise - Often if your device is infected with malware, then your hosts file may be compromised to included entries which could cause you harm. There are lists of common ad networks and tracking servers available online which you can use to keep an up-to-date list of sites to block.

Īd & content blocking - As the hosts file lets you override DNS entries for any domain name, people often create hosts file entries for common tracking, spyware, malware domains as well as product activation servers to assist with software piracy. This allows you to configure your system to respond to your local web server on and have your real site live on. Local development - Often setting up custom hostnames for local testing and development can be quite useful. You can flush your DNS cache, or modify your hosts file to temporarily force changes which are not updating fast enough. This allows you to make sure a new server setup is behaving as expected before making the changes to your DNS setup and having them live for everyone.įorcing DNS changes - Often when having made changes to your domain names DNS settings, you will need to wait for DNS propagation as you may have locally cached DNS records and are not seeing the expected updated results. Testing DNS changes - A common use for making changes to the hosts file is to test changes to DNS records before making them live on the internet. There are several reasons why you may be interested in viewing or editing your hosts file which include:

Hosts File - How and why to edit your DNS Hosts File Hosts File - How and why to edit your DNS Hosts File.
