This page is written for ISC BIND and these basics can be applied to any almost any DNS server.
Now to get this installed, you need to download and install BIND.
Now to get down to the basics:
- Unzip code.
- cd to binddir
- run ./configure
- run make and make install
Now for the fun part!
- Create a zone file (most are in /etc/named/) that contains the following:
$ORIGIN myblockdomain.example.com. @ 86400 IN SOA myblockdomain.example.com. username.mydomain.example.com. 2004020182 10800 3600 604800 86400 86400 IN A 127.0.0.1 86400 IN NS dns1 * 86400 IN A 127.0.0.1 dns1 86400 IN A 192.168.1.1
The line with the asterisk is a catch-all for subdomains under myblockdomain.example.com and so forth. You might need to replace 192.168.1.1 with the IP of your local DNS server. This will allow other local DNS servers to know where to go to find the route entry.
- Create the zones you want to block and point them to this file.
- Test away!!