Forcing DHCP to return alternate DNS servers - use dhcp_option

I've always been confused about the various LAN/WAN entry points for entering alternate DNS servers. I have been using the panel for years under Network, Interfaces, "Use custom DNS Servers" but I don't think this does anything. It wasn't until recently discovering a DNS "leak" website that I found I wasn't using the servers that were entered here after all. When I went to https://www.dnsleaktest.com/ I saw that my ISP DNS servers were still named, which was a surprise. All I can guess is that the option of "Use custom DNS Servers" must be for the internal scripts that run on the router, such as downloading OPKG, etc.

I did find a way to force DHCP to send my desired DNS servers to each client of the router and that was via selecting Network, Interfaces, LAN, Advanced Settings, DHCP Server, Advanced Settings and entering under "DHCP-options" a line of 6,x.x.x.1,x.x.x.2 (do NOT enter any kind of quote in here even though the help section seems to indicate it is needed). In this example x.x.x.1 represents the IP of the first DNS server and x.x.x.2 is the second server. As a result of this, entering the Windows command prompt ipconfig /all, I now saw the correct DNS servers showing on my windows workstation as I expected listed and a dnsleak test showed the DNS server I had entered was indeed now being used.

I assume this is working as designed.

OK, so one should understand, that OP asks - OP answers? And what is result of quotes?

On the WAN interface you need to deselect Use DNS servers advertised by peer and supply a list of custom servers. If you simply add servers elsewhere, they'll be used in addition to the ISP supplied ones.

Your DHCP options solution causes clients to bypass the router DNS cache which might or might not be what you want.

2 Likes

Nope: standard behaviour is to configure the external DNSs on the router, and use it as a cache for the clients in the network.

I would first follow @jow's advice, and ensure that the router uses your DNSs instead of those offered by your ISP.

Then, remove those options you added, and let the clients use the router as a caching name server.

2 Likes