[SOLVED] Change the router dns, to use my network dns

Ciao!

How are you today dude?

My problem is that I use my own DNS and via my clients it works. But when I SSH into the router the server still uses the ISP DNS server.
How can I set it up to use my own DNS in my router (via DHCP works, my clients gets the required IP addresses IPv4 and IPv6. all cool, but I need to use my router so many things, so I need to set it up to use my server DNS), also I need some like strict order so that only use the ISP DNS if my server DNS is down.

Do you know how to use it?
I got everything on LEDE LUCI , but I know idea which setting does it.

Please help!
Thanks so much!

PS:

IPv6 is good:

root@digi:~# ping ipv6.patrikx3.com
PING ipv6.patrikx3.com (2001:470:1f1b:5b3:21b:21ff:fea6:ce93): 56 data bytes
64 bytes from 2001:470:1f1b:5b3:21b:21ff:fea6:ce93: seq=0 ttl=64 time=0.232 ms
64 bytes from 2001:470:1f1b:5b3:21b:21ff:fea6:ce93: seq=1 ttl=64 time=0.297 ms
64 bytes from 2001:470:1f1b:5b3:21b:21ff:fea6:ce93: seq=2 ttl=64 time=0.274 ms
64 bytes from 2001:470:1f1b:5b3:21b:21ff:fea6:ce93: seq=3 ttl=64 time=0.285 ms
64 bytes from 2001:470:1f1b:5b3:21b:21ff:fea6:ce93: seq=4 ttl=64 time=0.285 ms
64 bytes from 2001:470:1f1b:5b3:21b:21ff:fea6:ce93: seq=5 ttl=64 time=0.300 ms

But I should get 192.168.78.20

But as you see:

root@digi:~# ping patrikx3.com
PING patrikx3.com (92.249.209.195): 56 data bytes
64 bytes from 92.249.209.195: seq=0 ttl=64 time=0.128 ms
64 bytes from 92.249.209.195: seq=1 ttl=64 time=0.077 ms
64 bytes from 92.249.209.195: seq=2 ttl=64 time=0.073 ms
64 bytes from 92.249.209.195: seq=3 ttl=64 time=0.074 ms
64 bytes from 92.249.209.195: seq=4 ttl=64 time=0.070 ms

It is the ISP DNS... :frowning:

You can customize the DNS server your router uses by setting network.wan.dns.

From command line:
uci set network.wan.dns='<list of space-separated DNS server IPs>'
uci commit network
reload_config

Using LuCI:
Click Network > Interfaces > Edit WAN > Advanced Settings > Use custom DNS servers

If you don't set custom DNS servers like this I think your router will just use whatever DNS servers are advertised by your ISPs DHCP server.

Ciao!
How are you?
Thanks so much! You are a magus! Now works.
But, I still need a little help, sometimes the server is down, for whatever, bug, backup or whatver, so what if my DNS server is down? Then my clients will not be able to use the DNS? Is there a setting like strict order or something like that so that only try 2nd if the first is failed? I think there is in DNSMASQ strict order, I guess with wan is nothing like that?

Thanks so much! Happy day!
Patrik

Hello Patrik - I'm well thanks :slight_smile:

A couple of things to try:

  • The network.wan.dns setting accepts more than one IP. I assume (but have never actually verified) that the order the DNS servers appear in the list indicates the priority - so the first IP in the list will get used unless its inaccessible in which case the next in the list will be used. So you could set your own DNS server IP first and then a few failover DNS server IPs after.

  • Look at the network.wan.peerdns setting. It's not clear from the documentation (https://lede-project.org/docs/user-guide/basic-ipv4-configuration) whether the DNS servers set in network.wan.dns take precedence over the DHCP-set DNS servers when this is enabled. If so, then you can simply add your own DNS server to network.wan.dns and when its unavailable, LEDE will fallback to the DHCP-assigned DNS. (I suspect the reverse is true however so give it a try.)

1 Like

Ok, i test it out tomorrow, thanks so much!
Take care!

Cool - let us know how it goes.

On a related note, I always try to avoid using my ISPs DNS servers in favour of those with no logging policies (assuming you believe/trust them). A list of free, public DNS servers to choose from is here: https://www.lifewire.com/free-and-public-dns-servers-2626062 .

yeah it works. thanks so much!

if i disable my server dns, it uses he.net or google, when i turn on, it uses my own dns. it is awesome, you are a god!

thanks again!
have a nice day!
ciao dude!

Please provide an example, like:

9.9.9.9 112.44.44.44 8.8.8.8 8.8.4.4

thanks, this is solved with lua and uci, i dont know how to flag it solved...

Click on the pencil icon to the right of the thread title and edit.

Then, click on the blue checkmark to save the change.

ok, thanks!

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