[Solved] Difference between setting DNS in DHCP-Options, "Use custom DNS servers", or DNS Forwardings

I see three places that I can set a DNS server for the router.

  1. Under DHCP settings in the field "DHCP-Options" with something like 6,192.168.1.15 (for PiHole, for example).
  2. Or putting this in the field called "Use custom DNS servers" in the Interface settings under Common Configuration
  3. 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.

1 Like
  1. tells DHCP clients to use the specified NS instead of the router
  2. tells OpenWrt to ignore upstream (ISP) DNS servers and hardcodes custom ones. Clients will go through OpenWrt's DNS cache
  3. 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.
6 Likes

Interesting. I have OpenWRT configured to use a specific DNS (Cloudflare) in a slightly different way:

  1. Left empty
  2. No custom DNS server set, but I have "Use DNS servers advertised by peer" unchecked on my PPPoE connection.
  3. 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! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.