Override DNS from ISP

Hi,

My DHCP's DNS server is extremely unreliable for some reason, with queries regularly failing. When my router gets a new IP address from the ISP, it will often not be able to update Dynamic DNS since it cannot resolve the Dynamic DNS hostname at that time.

If I edit /etc/resolv.conf with the DNS server(s) I want it to use, things work fine. And then when it renews the DHCP lease from the ISP every 30 minutes, my manually edited DNS servers there are overwritten.

I have manually specified other DNS servers for clients, but how can I tell the Router itself to use a specific DNS server for itself, and have that change stick?

Read the documentation regarding DNS

I did - as far as I can tell this refers to DNS for clients, not what the router itself uses for DNS. Am I mistaken?

Yes, you are - you can set a custom DNS here that your router will use, rather than the "Automatic" setting which will use the one your ISP provides via DHCP.

Are you referring to here?

That doesn’t work. I already tried that, tho thankfully it does work for clients who get their DHCP lease from the router.

You can see with that set, it’s using the ISP’s DNS it got from its DHCP lease.

Interesting - I just tried playing around with my Beryl and it seems you are right.

Although mine reports localhost - "SERVER: 127.0.0.1#53"

Which reflects resolv.conf.

Edit: Now that I actually read the info panel on the DNS page, it says

"When you set custom DNS servers, any DNS queries will be resolved through them (instead of the DNS servers obtained through network interface)"

I've just assumed those comments in the documentation are referring to clients of the router, not the router itself - but that was based on my own testing a couple of days ago when I originally reported this.

If I edit resolv.conf, it works as expected, but that gets overwritten every 30 minutes when a new DHCP lease is pulled from the ISP. So, seem to be back at square one - maybe gl-inet staff can comment on how for this to work correctly, or if a feature request needs to be made.

Yes, that was my point - I think that's what it means - my testing bears this out as well.

As you tested, this settings "GL GUI > Network > DNS" only affects DNS requests from clients.

Do you need the router itself to go to custom DNS?
What services does the router itself require custom DNS?

My ISP’s DNS, which it provides to the router via its DHCP lease, is unreliable and also sometimes slow.

So when the router gets a new DHCP lease and IP address, often it won’t be able to update Dynamic DNS with its new IP address since it can’t resolve the service’s host name to update. So I can’t access my router, and nor can I VPN into it.

From my experience, it’s common to be able to define custom DNS, even if you are using DHCP.

1 Like

Yes, it is, in fact I use this facility on my Asus home router.

Well, I see.

Please try to config the custom DNS server in the Luci.

1 Like

Thank you so much! I hadn't delved into Luci yet, but that did the trick. A before and after with my ISP and CloudFlare DNS:

ISP DNS:
root@GL-MT6000:~# dig @205.171.2.25 yahoo.com

;; Query time: 332 msec

CloudFlare DNS: (first / default entry in my router's DNS table, using Luci)
root@GL-MT6000:~# dig yahoo.com

;; Query time: 8 msec

;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)

1 Like