[Solved] DNS in OpenWrt

I have a ADSL2+ network running on Tp-Link TD-W8980 v1 with Openwrt 18.06.1 and I think my DNS resolving is quite slow. Sometimes I cant even browse certain sites and the page just keeps loading for at least 3 to 4 seconds just to start actually loading the web page. I have a 6 mbps downlink line with 1 mbps uplink and I am sure I can surf better than this.

My router connects to ISP's network through PPPoE and uses the DNS advertised by ISP (automatically), then I have set up Google DNS in DHCP configuration to forward the requests to.

I think it's taking longer because it has to resolve from two different DNSs, first from my ISP and then Google. AFAIK here most people suggest to use DHCP configuration to put DNS there but can I use my PPPoE connection to put the DNS there in the config? I think it would be rather better to use 1 DNS resolver than to use multiple DNS resolvers. I also tried to lookup DNS performance on the internet where I found dnsperf.com. Here they show the authoritative DNSs and then you can put another resolver there and see how the performance is.

So my actual question is: How can I increase DNS performance on my router? Should I really use my ISP DNS? Although even if I dont use ISP's DNS I can connect to it just fine. Thanks

I would try to use exclusively Google's DNS (or any other major player), at least as a test point to figure out where is the issue.

Configure the WAN connection to ignore the DNS supplied by your ISP, and tell DNSMASQ to use Google's servers.

if you want to try a different DNS server add the new server ip into the wan connection area
uncheck "Use DNS servers advertised by peer" and add the DNS server IP to "Use custom DNS servers"

you still want you pc's to ask you router to resolve everything so you local network names get resolved
also DNS stands for "Domain Name Servers" in this case it looks up a name to resolve an IP address
so the google DNS IP 8.8.8.8 is already an IP & is not need to be resolved

if you are like me & in a country like Australia it's better to use a non Australia public DSN other wise you limited to the Australian government filters and will block the lookup of site they don't want you to get to
I use 1.1.1.1 & 8.8.8.8 for mine

as for making it faster i'm not sure
i'm more thinking of DNS over a secure connection to make it harder for meta data to be captured

Incorrect. If the single DNS fails, you loose name resolution on your network. This is why RFCs state needing a primary and secondary. Dnsmasq only uses the first answer received anyways (this has other implications when a person mixes DNS servers that do blocking with others that do not).

If you're referring to response time, you must select 2+ of the fastest-responding (trusted) DNS servers - nearest to your location over the Internet.

Or sending all requests to those DNS IPs over VPN.

Yes, obviously I was referring to using Primary and Secondary but what I meant there was to use first DNS within my WAN connection and then other DNS in DNSMASQ. That configuration, in my belief, is leading to slow browsing because I think that it resolves from two different DNS servers, once from WAN and then from DNSMASQ.

Furthermore, I have done some ping tests and kinda have mixed results so I am not sure whether this is right or wrong but I think I will just use DNS servers in 1 place, that is WAN connection and let the DNSMASQ not to serve any additional DNS servers. I believe if I put DNS servers in both places it increases the ping from 160 to 270 ms for google.com.

Although I could be wrong but I would still like someone else's opinion here on what to do. I have basically 2 options: 1. To use DNS servers from WAN connection (any can be used) 2. Use DNS servers both in WAN and DNSMASQ.

I'm confused, you should decide what DNS you want to use and configure that on your WAN. Then leave the DNS entry blank on the LAN. Your router will tell the lan to use the router itself as DNS. The router itself will use whatever you put on the WAN. This two step process does not add latency because the request to your router takes about zero time it's the actual lookup on the wan that takes time

I'm wondering if your problem isn't bufferbloat. Your connection is quite slow, so any length of buffer at all will take quite some time to empty. Try configuring SQM first and then see if you still have this issue. You can even use dscp tags to put DNS queries into the diffserv4 streaming tin...

1 Like

According to @eduperez the configuration seems to be working pretty well. I am going to stick with it for now. As for SQM, I m already running it on my router but I will try to make some adjustments and see if it improves the overall performance. Thanks everyone.

1 Like

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