Advertisement
Guest User

aDNSblock by @vincesafe

a guest
Dec 27th, 2013
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.86 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # aDNSblock by vincesafe
  4. # @vincesafe on Twitter // vincesafe.fr
  5.  
  6. if [[ $EUID -ne 0 ]]; then
  7.    echo "You have to be root to run this script" 1>&2
  8.    exit 1
  9. fi
  10.  
  11. if [ ! -f /etc/init.d/bind9 ]
  12. then
  13.     echo "bind9 is required to use this script"
  14.     exit 2
  15. fi  
  16.  
  17.  
  18. echo "include \"adblock_include.conf\";" >> /etc/bind/named.conf.local
  19. wget http://spammerslapper.com/downloads/adblock_include.conf -O /var/cache/bind/adblock_include.conf
  20.  
  21. echo "$TTL  86400   ;" > /var/cache/bind/null.zone.file
  22.  
  23. echo "@       IN      SOA     server      root.localhost. (2012110100; 28800; 7200; 864000; 86400 ) ;" >> /etc/bind/null.zone.file
  24. echo "                NS      server" >> /etc/bind/null.zone.file
  25. echo "      A   127.0.0.1" >> /etc/bind/null.zone.file
  26. echo "*     IN      A       127.0.0.1" >> /etc/bind/null.zone.file
  27.  
  28. echo "You may restart bind9 to apply changes"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement