Temporarily block list of DNS names & subdomains

I want to temporarily block a list of ~8000 DNS domains and their subdomains. I saw the code example below in the docs. I have questions...

  1. What will the client see? DNS timeout? NXDOMAIN? Can I choose between those two behaviors?
  2. Will subdomains also be blocked?
  3. I can certainly format a list of 8000 commands to paste but is there anything wrong with doing it that way?
  4. Most importantly, how do I undo this when I am done testing?
# Blacklist
uci -q delete dhcp.@dnsmasq[0].server
uci add_list dhcp.@dnsmasq[0].server="/example.com/"
uci add_list dhcp.@dnsmasq[0].server="/example.net/"
uci commit dhcp
/etc/init.d/dnsmasq restart

The easiest option would be installing the luci-app-adblock package (NXDOMAIN), for which you can supply local blacklists (one domain per line).

Does this include sub-domains?

yep ... and you can suspend/resume adblock.

1 Like