Install the port: - # pkg install ipdbtools Update database: - # ipdb-update.sh ftp.apnic.net Query database: - # ipup -t MY -p -4 | sort > isp4.txt - # ipup -t MY -p -6 | sort > isp6.txt Include the txt files as an 'acl' in BIND9 - # cp isp*.txt /usr/local/etc/namedb/ - # vim named.conf - # Add the following at the top of the config file.. - # include "/usr/local/etc/namedb/isp4.txt"; - # include "/usr/local/etc/namedb/isp6.txt"; - # Edit the isp4.txt and add the acl tag and opening/closing brackets to the top and bottom of the file: -- # acl "isp4" { // top -- # IP blocks etc.. -- # }; // bottom - # ^ Do the same for isp6.txt. - # Use the acl's in allow-query, allow-query-cache & allow-recursion -- # allow-query { localhost; localnets; isp6; isp4; }; -- # allow-query-cache { localhost; localnets; isp6; isp4; }; -- # allow-recursion { localhost; localnets; isp6; isp4; }; Now only the IP blocks of your country are allowed to lookup dns using your dns server :> If there is a new IP block, just add it to the txt file and restart named.