How does a router with DHCP and a custom DNS set deal with client DNS settings?

I have a custom DNS server in my network that I want all clients to use (it has ad-filters etc, similar to PiHole).

I have set my router (LinkSys Velop) to use this DNS server. However, on the DNS server's admin page, I see only the Router doing DNS queries, not the clients. I would assume that the router (sooner or later) tells the clients to use the specific DNS server. Despite restarting the clients (and doing various other network reset actions such as ipconfig /flushdns etc, they do not seem to access the DNS server directly however: only the router does.

So far, the only way I could get the clients access the DNS server directly was by entering the DNS Server manually at the client network config.

So questions:

  • Is this expected behavior?
  • Is the DNS setting in a (or only my?) router simply making the router continue to "act" as a DNS server and re-direct the request to the set IP address, then sending the result back?
  • What do I have to do so that clients set a specific IP address as a DNS server? Do I have to setup my own DHCP server?
  • Do the usual (e.g. ISC DHCP as in CentOS?) linux DHCP servers tell the client which DNS server to use or do they as well just forward the requests instead?

thanks!


Solution 1:

A router, as in just device+software that does the IP packet forwarding doesn't do anything with DNS or DHCP at all...

Though since you mentioned a device that is commonly used as SOHO/home broadband router. That is a device that is acts provides routing, NAT, Firewall, DNS, DHCP, and many other services.

Anyway when a client that is configured for IPv4 DHCP and doesn't have any static config connects to a network it will send out a DHCP request, that will include a request for the option 6 data which is a list of IPs to be used for DNS. The DHCP server may provide an answer with a list of IPs. Once a client get an answer it will continue to use those DNS servers until the address is released, or renewed and provided updated information.

So if you want to force a client to get updated DNS settings from the DHCP server you need to do a renew on the client. Though a restart, or disconnecting, and reconnecting the network interface will usually also trigger this.

SOHO/Home routers are usually pretty unconfigurable with the stock firmware. You can often get more control using non-standard firmware. Or just running the services on some other device on your network.

Solution 2:

The DHCP server (probably running on your router) offers the clients the IP-address(es) of DNS servers they can use.

You need to adjust those.

If you can’t, a distinct possibility with SOHO routers, most likely the router itself will either offer clients the IP-addresses of the DNS server IP-addresses the router itself uses for DNS or the router will always offer its own IP-address as a DNS server. On the router you can then often (implicitly) configure forward and reverse DNS for your private network and for all other queries the router will forward the queries to its own external DNS servers.

In that latter example you will see that all client queries also seem to originate from the router IP-address