/  Frequently asked questions (FAQ) / Hosts files

 Frequently Asked Questions | Hosts Files

Hosts Files

Q: Where is the hosts file?

On Windows, the hosts are somewhat hidden in a system folder of Windows. In case of repeated changes, it is recommended to create a link to the system folder.

Anyone using systems other than Windows has the possibility to find out the exact paths e.g. on Wikipedia .

  Folder path hosts file Windows:
  1. Open the directory "*.*\Windows\System32\drivers\etc\"
  2. Copy the "hosts" file to the desktop or where you find it the easiest way to find it again. The further advantage is that it can be escaped from the system directory for editing. Who wants can of course also change directly in the system directory
  3. Open with a text editor of your choice, e.g. right-click "Open with"
  4. Copy the content from the lists offered into your hosts file or overwrite already existing hosts files with the offered versions of this website
  5. If you are unsure, do not forget to back up the original file.

Attention: Various programs like Kaspersky can cause difficulties in editing the hosts. Learn more about this behaviour under Security.

Please also note that the described procedure and the associated problems only apply to the contents of the Other providers of hosts files and content should always be checked before use

Loopback and Localhost

Q: Difference between und

For the offered filters, - and adblock lists, the is used for existing entries to show that a host entry is unreachable. In short: traffic from the device to the Internet and vice versa no longer takes place.

The (localhost) as found in various lists is not used.

The address can be used as loopback traffic communication within the same host and thus fulfills a completely different function. In addition, is a little faster in processing, takes up less space and is therefore more suitable for our purposes.

Reset Hosts File

Q: How to reset the hosts file?

During a virus infestation or carelessness, the hosts may be quarantined, modified or even accidentally deleted by third-party programs.

A separate article described how to reset the hosts file.

Hosts file does not apply

Q: What to do if the hosts file does not apply?

There are several reasons why the hosts ignore custom rules.

  1. Program traffic is directed directly to an IP addresst
  2. Write errors and/or syntax errors
  3. Addresses have been changed by the providers
  1. Enter Ipv4 & Ipv6 addresses into a firewall. Alternatively, block each exe file
  2. Check the hosts for errors. Classics are forgotten spaces or # Hash symbols
  3. Check the inbound and outbound Internet traffic and adjust existing rules if necessary.

Hosts vs Firewall

Q: Does a hosts file or firewall make more sense?

What makes sense is individually dependent on the person. Both hosts files and firewalls can work together hand in hand. Everyone has to decide for themselves what is the right thing to do.

Hosts Benefits

Q: What are the advantages of a hosts file?

  1. Easy to use
  2. Does not require additional addons or programs
  3. Unlike the firewall, individual services can be blocked via hosts
  4. As a basis compatible with other protective mechanisms
  5. System-wide block of unwanted connections in games, programs and websites
  6. Can be used on desktop AND mobile devices such as tablets or phones

Another advantage is that host files are used as a basis for other applications such as PI-Hole, DNSFilter or other programs, which often provide completely different ways of handling. Those who use PI-Hole can have hosts read files and benefit, for example, from a centralized protection option for all devices in their own network.

Hosts Disadvantages

Q: What are the disadvantages of the hosts file?

The hosts file has some disadvantages that you have to calculate as a user. Which these are, as follows.

  1. IP addresses are not supported and must be managed through your own firewalls
  2. If multiple devices are to be protected (without PI or similar environments), one hosts file per device is required
  3. The hosts file fails for generic and encoded content (SVG, Base64) No use of regex and/or wildcards
  4. No use of regex and/or wildcards
  5. Depending on the type, software can override rules created in the hosts
  6. Not sorted lists can become confusing

Hosts Syntax

Q: How is the hosts file structured?

The syntax of the hosts file is kept simple. In principle,

  1. One entry per line.
  2. An entry to a service is completely sufficient. Multiple denominations are ignored.

For the example we use the american advertising company Rubiconproject

  # Rubiconproject
# # Mobile devices
  1. Line 1:
    The rhombus # in the first line stands for a comment or disabled entry and is also regarded as such. This allows you to write notes to the hosts file or disable entries.
  2. Line 2:
    The before shares the device with the incoming and outgoing internet traffic to block. Say the device is not available.
  3. Line 3:
    An entry with a previous diamond as in line three informs the system that this entry is commented out and thus allowed. In this case, we get to see advertisements on the Internet from this provider.
  4. Line 4:
    The entry is blocked. However, there is a comment at the end of the line. The address itself is blocked. The comment itself is viewed as such does not bother any further.