Hi everybody,
I found an excellent guide at dalemacartney.com with instruction on how to forward a DNS request to specific DNS server based on the domain name. This works great for DNS requests from clients on LAN side, but I need it for scripting purposes and the rules are bypassed when doing :resolve from terminal.
I anyone can help me it would be much appreciated. These are the rules from Dale that makes the magic happen ![]()
[admin@RouterOS] > /ip firewall layer7-protocol add name=example.com regexp=example.com
[admin@RouterOS] > /ip firewall mangle add chain=prerouting dst-address=10.0.0.254 layer7-protocol=example.com action=mark-connection new-connection-mark=example.com-forward protocol=tcp dst-port=53
[admin@RouterOS] > /ip firewall mangle add chain=prerouting dst-address=10.0.0.254 layer7-protocol=example.com action=mark-connection new-connection-mark=example.com-forward protocol=udp dst-port=53
[admin@RouterOS] > /ip firewall nat add action=dst-nat chain=dstnat connection-mark=example.com-forward to-addresses=10.0.1.11
[admin@RouterOS] > /ip firewall nat add action=masquerade chain=srcnat connection-mark=example.com-forward
Thank you all in advance.