On my old non-OpenWrt router I used Adguard DNS to filter ads for every device on my network. I've done the same now on my new OpenWrt router in Network>Interfaces>LAN settings>DHCP Server>Advanced Settings and added "6,94.140.15.15,94.140.14.14" to DHCP-Options.
While this appears to work correctly, I'm wondering if there is a better method that I should be using under OpenWrt?
Side question: after applying this DNS setting and reboot, when I view /etc/resolv.conf it is showing nameserver 127.0.0.1. Why does this not show 94.140.15.15?
Thanks for pointing that out Ninja, I've added the Adguard DNS IPs to the WAN and WAN6 interfaces. Still appears to function correctly, blocking ads on my cell, but /etc/resolv.conf still shows 127.0.0.1.
In /etc/resolv.conf you see the localhost, as OpenWrt comes with dnsmasq preinstalled by default, which handles the DNS queries forwarding to the upstream nameservers.
You could change the content of resolv.conf to point to some other forwarder, like Adguard, however this change is not retained after flashing a new firmware. Furthermore in most of the case the /etc/resolv.conf is a symbolic link to /tmp/resolv.conf , which means that changes will be lost after reboot. While you could delete the symlink and recreate the /etc/resolv.conf with the contents of your choice, it won't survive a flashing, unless you add it in the preserved files.
Therefore the solution provided from @ninjanoir78 is prefered as it can have the results you need and will survive reboot/flashing.