TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Amalgamated hosts file

4 点作者 2a0c40超过 9 年前

2 条评论

skanga超过 9 年前
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>
2bluesc超过 9 年前
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.