Linux Mint provides you with the domain name based blocking called mintnanny.
start mintnanny
add the domain names you want to block.
start mintnanny
| hat1 ~ # mintnanny |
add the domain names you want to block.
when accessing to www.bad.jp . blocked.
The technique is very simple. mintnanny just adds the domain names in /etc/hosts file.
| hat1 ~ # cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 hat1 # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 0.0.0.0 www.bad.com # blocked by mintNanny 0.0.0.0 www.bad.jp # blocked by mintNanny |
So this function will work unless the name resolution order in /etc/nsswitch.conf is “dns files”.
| hat1 ~ # egrep hosts /etc/nsswitch.conf hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 |