I see three places that I can set a DNS server for the router.
Under DHCP settings in the field "DHCP-Options" with something like 6,192.168.1.15 (for PiHole, for example).
Or putting this in the field called "Use custom DNS servers" in the Interface settings under Common Configuration
Or under DHCP and DNS settings in the DNS Forwardings field
What is the difference between each of these? I would like to configure it so that every device connected to my router, whether via ethernet or wifi, uses this as its only DNS server.
tells DHCP clients to use the specified NS instead of the router
tells OpenWrt to ignore upstream (ISP) DNS servers and hardcodes custom ones. Clients will go through OpenWrt's DNS cache
Is rather intented to forward specific domains to specific NS servers, to implement some kind of "DNS routing", e.g. resolve company intranet domains via a different NS only reachable via VPN without having to direct all queries to it.
Interesting. I have OpenWRT configured to use a specific DNS (Cloudflare) in a slightly different way:
Left empty
No custom DNS server set, but I have "Use DNS servers advertised by peer" unchecked on my PPPoE connection.
I've set the domain name/local server for my LAN and configured dnsmasq to forward valid requests that don't match the configured domain.
It works like you expect, any local domain address or hostname is resolved by dnsmasq, never forwarded. Anything else is recursively answered upstream and cached locally.
It looks like if I put my DNS address in 2. "Use custom DNS servers" and uncheck "Use DNS servers advertised by peer" as @ergamus mentioned then my DNS address is the only one used by devices on the network. Thanks for the help!