rdr-to works perfectly! my hair is droppng off from the speed, without ADs :) Many thanks. Wishing a great year-end for everybody!! Sent: Thursday, December 19, 2019 at 8:50 PM From: "Anthony O' Brien" <anth...@bearonis.com> To: "lu hu" <luhu8...@mail.com> Cc: misc@openbsd.org Subject: Re: OpenBSD pf - redirect all DNS queries to local DNS server Long time reader, first time writing in... > The big question: Is there any DOC for OpenBSD about this? What pf rules > needed to redirect any DNS server (ex.: 8.8.8.8 or 1.1.1.1) requests to the > DNS server running on the ROUTER, coming from the CLIENTS? You can use rdr-to[0] with pf to redirect all DNS queries to the DNS resolver running on the router. A rule in pf.conf would look something like:
pass in on $int_if proto { udp , tcp } from any to any port domain \ rdr-to $dns_server port domain Ted Unangst has short write-up about turning your network inside out to do just this[1]. [0]: https://man.openbsd.org/pf.conf.5#rdr-to [1]: https://flak.tedunangst.com/post/turn-your-network-inside-out-with-one-pfconf-trick