For DNS-based on openwrt specifically: https://openwrt.org/docs/guide-user/services/ad-blocking
Try them out and see which one you prefer.
All these work similarly to pihole. If you choose an option that integrates with ipset, you can get slightly stronger than by blocking IPs associated with hostnames.
As others mentioned, it's good to couple with a client-side filter like uBlock origin.