Hacker News new | past | comments | ask | show | jobs | submit login
Amalgamated hosts file (github.com/stevenblack)
4 points by 2a0c40 on Nov 20, 2015 | hide | past | favorite | 2 comments



Was this complexity needed?

It's just a few lines in bash

  #!/bin/bash
  wget "http://adaway.org/hosts.txt" -O- > hosts
  wget "http://www.malwaredomainlist.com/hostslist/hosts.txt" -O- >> hosts
  wget "http://winhelp2002.mvps.org/hosts.txt" -O- >> hosts
  wget "http://someonewhocares.org/hosts/zero/hosts" -O- >> hosts
  wget "https://raw.githubusercontent.com/StevenBlack/hosts/master/data/StevenBlack/hosts" -O- >> hosts
  wget "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext&useip=0.0.0.0" -O- >> hosts

  mv hosts /etc/hosts

  # Flush DNS cache as per your OS
  # Mac OS X
  # dscacheutil -flushcache
  # Linux 
  # /etc/rc.d/init.d/nscd restart
  # Linux with systemd: 
  # systemctl restart network.service
  # Fedora Linux 
  # systemctl restart NetworkManager.service
Or in a windows batch file

  wget "http://adaway.org/hosts.txt" -O- > hosts
  wget "http://www.malwaredomainlist.com/hostslist/hosts.txt" -O- >> hosts
  wget "http://winhelp2002.mvps.org/hosts.txt" -O- >> hosts
  wget "http://someonewhocares.org/hosts/zero/hosts" -O- >> hosts
  wget "https://raw.githubusercontent.com/StevenBlack/hosts/master/data/StevenBlack/hosts" -O- >> hosts
  wget "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext&useip=0.0.0.0" -O- >> hosts
  move hosts %SystemRoot%\system32\drivers\etc\hosts
  ipconfig /flushdns


I'm giving it a try since I had previously used a much short list.

One thing to be careful of is auto-completion tools. Something like `ssh <tab><tab>` could dump the 30k list to your console as zsh + prezto does in my case.

To workaround this, I run a local DNS server (DNS masq) and provide it 'addn-hosts=/etc/hosts.blacklist' and place the blacklist there.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: