internet outage due to wrong DNS & route

Hi guys
On my server(P4), i have ROS with 4 NICs, one for the WAN link, 3 for hotspot.
The first hotspot is on IP 172.21.51.251
The second on 192.168.100.1 and the 3rd is on 192.168.0.1.
I have userman installed on the same machine and things seem to be going on fine.

But I’ve always notice that the primary DNS do change at times, it normally changes to the IP of one of the hotspots also a route rule will be automatically added to the route list, the route will also be pointing to the IP of one of the hotspots as the gateway.

Whenever this happens, the internet becomes inaccesible untill I change the Primary DNS and remove the newly added route rule.

At first I taught it was some kind of bug in the 2.9.45 ROS, So I upgraded to the 3.4 only to discover that thinds are still the same.

The DNS settings specified during your hotspot setup will be used as your primary setup. Since you installed 3 hotspot interfaces with a different DNS server for each of them, it probably changes your primary DNS at random.

I usually use these firewall dst-nat entries to force all tcp and udp ports 53 to a certain address/dns server:

1 chain=dstnat action=dst-nat to-addresses=1.1.1.1 to-ports=53
src-address=0.0.0.0/0 dst-port=53 protocol=tcp

2 chain=dstnat action=dst-nat to-addresses=1.1.1.1 to-ports=53
src-address=0.0.0.0/0 dst-port=53 protocol=udp

Where 1.1.1.1 is your upstream DNS server

This might be a workaround for your problem if you can’t find the actual cause.