require 'resolv'module DNSFilterModule class ResolvableCheck def initialize(config, logger) @config = config @logger = logger @resolver_cfg = config['ResolvableBy'] @dns = Resolv::DNS.new(:nameserver => @resolver_cfg['nameserver'] ,:search => @resolver_cfg['search'],:ndots => 1) end def process(name, res_class, transaction) if res_class.to_s.include? '::A' begin @dns.getaddress(name) return rescue Resolv::ResolvError => ex raise DNSBlockException.new end end end endend
I was further thinking, wouldn't this be a reasonable marketing point if, say, would be somehow integrated into OPNsense?
For example, you can have the customizable power of OpenDNS to block malware and the non-customizable AdGuard servers to block ads under one hood.