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.

Amalgamated hosts file

4 pointsby 2a0c40over 9 years ago

2 comments

skangaover 9 years ago
Was this complexity needed?<p>It&#x27;s just a few lines in bash<p><pre><code> #!&#x2F;bin&#x2F;bash wget &quot;http:&#x2F;&#x2F;adaway.org&#x2F;hosts.txt&quot; -O- &gt; hosts wget &quot;http:&#x2F;&#x2F;www.malwaredomainlist.com&#x2F;hostslist&#x2F;hosts.txt&quot; -O- &gt;&gt; hosts wget &quot;http:&#x2F;&#x2F;winhelp2002.mvps.org&#x2F;hosts.txt&quot; -O- &gt;&gt; hosts wget &quot;http:&#x2F;&#x2F;someonewhocares.org&#x2F;hosts&#x2F;zero&#x2F;hosts&quot; -O- &gt;&gt; hosts wget &quot;https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;StevenBlack&#x2F;hosts&#x2F;master&#x2F;data&#x2F;StevenBlack&#x2F;hosts&quot; -O- &gt;&gt; hosts wget &quot;http:&#x2F;&#x2F;pgl.yoyo.org&#x2F;adservers&#x2F;serverlist.php?hostformat=hosts&amp;mimetype=plaintext&amp;useip=0.0.0.0&quot; -O- &gt;&gt; hosts mv hosts &#x2F;etc&#x2F;hosts # Flush DNS cache as per your OS # Mac OS X # dscacheutil -flushcache # Linux # &#x2F;etc&#x2F;rc.d&#x2F;init.d&#x2F;nscd restart # Linux with systemd: # systemctl restart network.service # Fedora Linux # systemctl restart NetworkManager.service </code></pre> Or in a windows batch file<p><pre><code> wget &quot;http:&#x2F;&#x2F;adaway.org&#x2F;hosts.txt&quot; -O- &gt; hosts wget &quot;http:&#x2F;&#x2F;www.malwaredomainlist.com&#x2F;hostslist&#x2F;hosts.txt&quot; -O- &gt;&gt; hosts wget &quot;http:&#x2F;&#x2F;winhelp2002.mvps.org&#x2F;hosts.txt&quot; -O- &gt;&gt; hosts wget &quot;http:&#x2F;&#x2F;someonewhocares.org&#x2F;hosts&#x2F;zero&#x2F;hosts&quot; -O- &gt;&gt; hosts wget &quot;https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;StevenBlack&#x2F;hosts&#x2F;master&#x2F;data&#x2F;StevenBlack&#x2F;hosts&quot; -O- &gt;&gt; hosts wget &quot;http:&#x2F;&#x2F;pgl.yoyo.org&#x2F;adservers&#x2F;serverlist.php?hostformat=hosts&amp;mimetype=plaintext&amp;useip=0.0.0.0&quot; -O- &gt;&gt; hosts move hosts %SystemRoot%\system32\drivers\etc\hosts ipconfig &#x2F;flushdns</code></pre>
2bluescover 9 years ago
I&#x27;m giving it a try since I had previously used a much short list.<p>One thing to be careful of is auto-completion tools. Something like `ssh &lt;tab&gt;&lt;tab&gt;` could dump the 30k list to your console as zsh + prezto does in my case.<p>To workaround this, I run a local DNS server (DNS masq) and provide it &#x27;addn-hosts=&#x2F;etc&#x2F;hosts.blacklist&#x27; and place the blacklist there.