DNS Settings in OpenWrt

There was a post asking about dns settings earlier and @Grommish recommended the dns forwarding method, I set my dns in wan (network > interfaces > advanced settings > uncheck use dns advertised by peer), but I've seen both ways recommended about equally and they both seem to work fine. Just wondering if anyone has an opinion on whether there's a preferred method or not.

1 Like

Something to keep in mind, that post you reference (How to change DNS on Putty) was dependent on the fact the OP was using Router mode, so was hosting his own DHCP/DNS on device.

So instead of his local DNS server relaying up to the ISP, it's being sent to the alternative addresses..

In the situation changing the Interface, that's for assigning the DNS for the device itself (assuming it was on the WAN). Probably wouldn't matter to most people, but if you wanted the device to only point to an internal DNS rather than a public one? Not sure what the practical use case would be though.

3 Likes

In a default setup lan host will ask OpenWrt dnsmasq nameserver to resolve hostnames. Dnsmasq will use the nameservers advertised by the ISP or populated manually in the wan interface for upstream queries.
Now, in case you have a nameserver in the lan, like a Pihole, you should add that under lan interface.
However with this setting you cannot specify a custom port (or some other details). And this is where server option comes in handy.

3 Likes