Our little home network:


ROUTER: OpenBSD 6.5, giving DHCP+fwing internet to the WIFI APs. Based on https://www.openbsd.org/faq/pf/example1.html#pf and https://www.openbsd.org/faq/pf/example1.html#dhcp

CLIENTS: laptops, smartphones.

So everything is going through the ROUTER.

We can see a https://www.openbsd.org/faq/pf/example1.html#dns DOC for how to setup a DNS server, ~ok.

AD filtering. We would like to have one, but not a fancy one, just a working one.

Based on "bad hosts", ex.: if a client queries iamAD.foo, then answer it back as, so the clients will try to connect to themselfes, which will end up not showing the AD.

The big question: Is there any DOC for OpenBSD about this? What pf rules needed to redirect any DNS server (ex.: or requests to the DNS server running on the ROUTER, coming from the CLIENTS?

So ex.: if a smartphone CLIENT wants to query iamAD.foo domain to get ADs, it will only get back

  • 1
    Silly question for you: why don't you tell your APs to hand out the routers IP as the DNS server with the DHCP leases? Or, if your APs only pass the DHCP requests on to the router, have the router do this? – tink Dec 25 '19 at 21:10



pass in on $int_if proto { udp, tcp } from any to any port domain rdr-to port domain
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.