TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using hosts file to block ads

2 pointsby anilshanbhagover 13 years ago

1 comment

infinityover 13 years ago
It is generally not true that nothing exists at 127.0.0.2. For example I have a local Apache server running.<p>If you are using the hosts file to block the resolution of domains, you can use 0.0.0.0 which is really false. The blocked domain will not be resolved, because the operating system will recognize 0.0.0.0 as false, and a local webserver running on port 80 will not see the requests.<p>The hosts file is not optimized for large amounts of data, so if this is used to block an excessive number of domains and subdomains, the whole process of name resolution will be slowed down.<p>The good thing is that a block via the hosts file applies to the whole system and all browsers.<p>Another bad thing is that the hosts file does not support something like wildcards or regular expressions, each domain or subdomain has to be blocked individually.