How to block subreddits with BIND9?

Posted by user1391189 on Super User See other posts from Super User or by user1391189
Published on 2012-06-07T04:29:10Z Indexed on 2012/06/07 4:42 UTC
Read the original article Hit count: 484

Filed under:
|
|
|

Please help me block NSFW subreddits like this one (http://www.reddit.com/r/NSFW/)

I would like to keep access to SFW subreddits, but block certain subreddits that are distracting or NSFW. I know how to filter domains. (see files below) But how do I apply the filter only to certain subreddits?

So far I have set up the following files:

blocklist.conf

zone "adimages.go.com" { type master; file "dummy-block"; };
zone "admonitor.net" { type master; file "dummy-block"; };
zone "ads.specificpop.com" { type master; file "dummy-block"; };
...

named.conf

options {
allow-query { 127.0.0.1; };
allow-recursion { 127.0.0.1; };
directory "c:\bind\etc";
notify no;
};

zone "." IN {
type hint;
file "c:\bind\etc\named.root";
};

zone "localhost" IN {
allow-update { none; };
file "c:\bind\etc\localhost.zone";
type master;
};

zone "0.0.127.in-addr.arpa" IN {
allow-update { none; };
file "c:\bind\etc\named.local";
type master;
};

key "rndc-key" {
algorithm hmac-md5;
secret   "O5VdbBKKEMzuLYjM60CxwuLLURFA6peDYHCBvZCqjoa6KtL1ggD7OTLeLtnu2jR5I5cwA/MQ8UdHc+9tMJRSiw==";
};

controls {
inet 127.0.0.1 port 953 allow { 127.0.0.1; } keys { "rndc-key"; };
};

//Blocklist
include "c:\bind\etc\blocklist.conf";

dummy-block

$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                          2         ; Serial
                     604800         ; Refresh
                      86400         ; Retry
                    2419200         ; Expire
                     604800 )       ; Negative Cache TTL
;
@       IN      NS      localhost.
@       IN      A       127.0.0.1
*       IN      A       127.0.0.1

© Super User or respective owner

Related posts about filter

Related posts about blocking