Setting up MikroTik/RouterOS with Conditional DNS Forwarding (UnoTelly/UnblockUS)

I have a MikroTik RouterOS device that has some custom DNS settings and therefore I cannot change the DNS servers it provides to clients, which is a requirement to use UnoTelly or Unblockus. Instead I found the following article very helpful, it allows you to configure Conditional DNS forwarding for specific domains.

https://www.dalemacartney.com/2012/12/29/dns-conditional-forwarders-with-mikrotik-routeros/

This works well because I use MediaHint to swap back and forth for NetFlix US and Canada, but use only the US Amazon Prime.

/ip firewall layer7-protocol add name=domain.com regexp=domain.com
/ip firewall mangle add chain=prerouting dst-address=<routeripaddress> layer7-protocol=domain.com action=mark-connection new-connection-mark=domain.com-forward protocol=tcp dst-port=53
/ip firewall mangle add chain=prerouting dst-address=<routeripaddress> layer7-protocol=domain.com action=mark-connection new-connection-mark=domain.com-forward protocol=udp dst-port=53
/ip firewall nat add action=dst-nat chain=dstnat connection-mark=domain.com-forward to-addresses=<UnoTellyDNSServerIPAddress>
/ip firewall nat add action=masquerade chain=srcnat connection-mark=domain.com-forward

 


Did you like this article?


0 Shares:
You May Also Like

A list of changes and fixes in the iPhone 2.1 Firmware

There is a full list of changes and fixes in the new iPhone 2.1 firware on Apples site, which you can read here: http://www.apple.com/iphone/softwareupdate/ I've also included them below:
General Updates * Decrease in call set-up failures and dropped calls. * Significantly better battery life for most users. * Dramatically reduced time to backup to iTunes. * Improved email reliability, notably fetching email from POP and Exchange accounts. * Faster installation of 3rd party applications.
Read More