How to separate DNS server for each client/network

Hello,

I’m using ROS 2.9.42 which has IP e.g. 1.1.1.1

I have client-X, client-Y, all use static IP, and all request for DNS to my mikrotik (1.1.1.1)

I have ISP-A and ISP-B.
Each ISP will not allow outside of their network to access DNS request.

In normal situation in routing:
client-X use ISP-A
client-Y use ISP-B


Question 1:

How can I set on ROS, all DNS request from client-X, will only be forwarded to DNS server of ISP-A
It means also, DNS request from client-Y will only be forwarded to DNS server of ISP-B.
I would not like to use public DNS server, which is I am using this option now.

Does mikrotik have already this “ready-made-built-in” feature?


Question 2:

If ISP-A goes down, I set failover for client-X to be routed to ISP-B. In this case, I would like to forward DNS request from client-X to DNS server of ISP-B.

Does mikrotik have already this “ready-made-built-in” feature?


Sorry to use X,Y,A,B, I hope it will picture of my question easier.
My guess is, the “NON SIMPLE” solution is by using NAT-masquerade, script, netwatch, etc.


Comments please?

Thank you in advance.

Use public DNS server, I have two of them and I do not remember, when I got problems that both of them are not accessible.

You may create DST-NAT rules, that redirects one group DNS traffic to one DNS server and second group to another. DST-NAT rules do not have any failover features, that’s why you have to use script to monitor both server and change DST-NAT rule in case any of the DNS server fail.

Hello Sergejs,

Thank you for the enlightenment.

Yup, right now i am using 2 public DNS servers which are reachable in 300-400ms, this is what I dont like, while local DNS server can be reached in 30-50ms. Well for a machine >200ms differences is “too long” while NONE of my human clients can feel the difference :smiley:

I guess I should try your suggestion about DST-NAT and script.

Thanks again.