Routing mark how to

I have two getways one default and second is routing mark some packets, and now I whant to pass Mikrotik DNS chache I try but don’t khow how to mark internal packets to pass second getway. DNS chache work but only with default getway.
Any one some idea how to routing marks packets from DNS chache ? RouterOS is v2.9.42.


Best regards…

My implementation is the following:

First, I dst-nat all UDP and TCP port 53 traffic to the IP of my DNS server (I have a dedicated MT server for this function). In both DST rules, I exclude the IP address of that DNS MT server, so port 53 traffic originating from the MT will not be NATted.

Now you can add a Mangle rule in the src-nat chain where your src-address is your server’s IP, and the action is mark routing. Under IP/Routes creat a rule to route your traffic mark via the desired line.

I prefer to use Routing Rules, as you can specify in one list which rules has to be processed first. Before any routes, I created rules for all internal IP’s to first go to the MAIN lookup table.

Other important notes:

Remember your MT DNS cache can’t be larger than 10240KB. I wrote a simple script to flush the DNS once it reaches 10000KB.

If you need more info, pop me a reply with what you have accomplished and I’ll give more info or help.

Thanks. I try this.

Best regards.