Community discussions

MikroTik App
 
dragonauta
newbie
Topic Author
Posts: 28
Joined: Thu Feb 02, 2017 12:50 am

Dual WAN failover messes with DNS

Tue May 17, 2022 1:08 am

Hi, I have a really simple dual wan failover setup.
Both ISP give dynamic IP, so I configured two dhcp client
/ip dhcp-client
add default-route-distance=1 disabled=no interface=ether1 comment="ISP1"
add default-route-distance=2 disabled=no interface=ether2 comment="ISP2"
So far, so good. When ISP1 doesn't work, I just unplug cable and ISP2 takes priority.
Routes list and DNS changes automatically.

My problem is that when ISP1 restores its service, I plug in the cable and then
Routes list change, as ISP1 has distance=1 but...
DNS doesn't change. it keeps resolving on dns servers from ISP2.

In DNS list, I see both DNS servers from ISP2 at top of the list followed by DNS servers from ISP1.
This brings several problems like an IP doorbell stop working, weird issues on navigation...

any hint?
 
tdw
Forum Guru
Forum Guru
Posts: 1843
Joined: Sat May 05, 2018 11:55 am

Re: Dual WAN failover messes with DNS

Tue May 17, 2022 1:27 am

As you have multiple DNS servers added by having the DHCP client setting use-peer-dns=yes there is no control over which of the listed servers will be used. If the ISPs only permit DNS lookups from their servers via their connection you may well get lookup failures. The simplest fix is to set one or more non-ISP DNS provider (e.g. Google, quad9, Cloudflare, etc.) as servers under /ip dns and set the DHCP clients use-peer-dns=no
 
dragonauta
newbie
Topic Author
Posts: 28
Joined: Thu Feb 02, 2017 12:50 am

Re: Dual WAN failover messes with DNS

Tue May 17, 2022 3:54 am

As you have multiple DNS servers added by having the DHCP client setting use-peer-dns=yes there is no control over which of the listed servers will be used. If the ISPs only permit DNS lookups from their servers via their connection you may well get lookup failures. The simplest fix is to set one or more non-ISP DNS provider (e.g. Google, quad9, Cloudflare, etc.) as servers under /ip dns and set the DHCP clients use-peer-dns=no
Thank you tdw!
Will try tomorrow, but I know it'll work.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19125
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Dual WAN failover messes with DNS

Tue May 17, 2022 5:02 am

Who is online

Users browsing this forum: anav, tiklavirus and 10 guests