It doesnt work because your requirements are not clearly stated.
Do you mean USE the DNS services of the router via WAN2 ( USE DNS server of the router )
OR
Do you mean use some DNS server you have on LAN via WAN2 ( port forward to DNS server on the LAN)
Finally, how do you propose or better WHY, are you proposing to use DNS services from external sources WITHOUT any encryption…
I would recommend NEVER to open up your DNS to the outside www…
What could be unclear here?
Mikrotik as a DNS-server.
I’m trying to pass DNS-requests through gateway 2.
For this I use rules in the output-chain.
In the connections I see that the router continues to use gateway 1.
Did you try this…dont think you need connection marks here. /ip mangle
add chain=output dst-port=53 protocol=udp new-routing-mark=isp2_table passthrough=no
add chain=output dst-port=53 protocol=tcp new-routing-mark=isp2_table passthrough=no
Then post complete config as the issue may be elsewhere
/export file=anynameyouwish ( minus router serial number any public wan IP information, keys etc. )
Not sure what you are getting at…
The routing rule is not about forcing internal router DNS services out WAN2.
Its strictly about forcing any query to 1.1.1.1 out WAN2.
In any case, since you dont want to provide config, I am outta here.
I look at the logs, the traffic still goes through the first provider: postrouting: in:(unknown 0) out:ether3, connection-mark:conn_3 connection-state:new proto UDP, 111.111.111.111:xxxxx->1.1.1.1:53, len 65 here 111.111.111.111 - is the address of the first provider ISP1
I do it for ipsec, like here https://wiki.mikrotik.com/wiki/Manual:IP/IPsec#Using_different_routing_table
/ip firewall mangle
add action=mark-connection chain=output connection-mark=no-mark connection-state=new dst-address=xxx.xxx.xxx.xxx dst-port=500,4500 new-connection-mark=conn_3 protocol=udp
add action=mark-connection chain=output connection-mark=no-mark dst-address=xxx.xxx.xxx.xxx new-connection-mark=conn_3 protocol=ipsec-esp
add action=mark-routing chain=output connection-mark=conn_3 new-routing-mark=isp3_table passthrough=no
The logs show the correct address of provider 3 (333.333.333.333): postrouting: in:(unknown 0) out:ether3, connection-mark:conn_3 connection-state:established proto UDP, 333.333.333.333:4500->yyy.yyy.yyy.yyy:4500, len 316
NTP-server also only goes through the first provider! WG also only from the address of the 1st provider!