Clearing DNS Service Cache on Synology NAS

If you’re using the Synology DNS server for your local clients or services on the Synology NAS, then you might need to clear it’s cache.

It’s really simple, and after googling I couldn’t find a straight answer. So I did some digging and found this was the appropriate way to clear the DNS Service Cache on a DSM6.x

  1. Login via SSH as root
  2. Run “/var/packages/DNSServer/target/script/flushcache.sh”

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