Community discussions

MUM Europe 2020
just joined
Topic Author
Posts: 10
Joined: Fri Aug 03, 2018 5:04 am

Feature Request: Conditional DNS Forwarding

Thu Sep 13, 2018 11:03 pm

It would be brilliant to add conditional DNS forwarding to the Caching DNS Forwarder in RouterOS. That is, the ability to specify "if a request comes in for a record under suffix, forward it to rather than the normal DNS server". This is particularly helpful for allowing private DNS zones to be resolved across a VPN link while still allowing public DNS zones to be resolved by some local public DNS server (especially useful so that you don't lose DNS when the VPN link goes down!).

I'm fully aware of the trick to implementing this using NAT, Mangle, and Layer7 Protocol rules in the firewall. However, that solution has various problems, including one huge one.
  • The big one is that it only works for DNS queries over UDP; any DNS query over TCP will just fail if this method is attempted. Obviously DNS mostly uses UDP, but it'll fall back to TCP and break at surprising times.
  • A smaller issue, but a real one, is that implementing this method requires understanding the details of UDP DNS packet structure. Most of the tutorials on these forums and elsewhere get the regular expressions wrong.
  • Requests that get handled by the Layer7 NAT trick don't get their results cached by the Mikrotik, so they have to be forwarded every time.

If Mikrotik doesn't want to add this as a core feature of the RouterOS DNS Forwarder, I'd love to see a more fully-featured DNS forwarder added as a separate package, the way the fully-featured NTP client and server are.
Forum Guru
Forum Guru
Posts: 5031
Joined: Mon Apr 20, 2009 9:11 pm

Re: Feature Request: Conditional DNS Forwarding

Fri Sep 14, 2018 3:31 am

Yes please. I really want to do something like:
/ip dns
set servers=,
/ip dns forwarders
add domain=company1.lan servers=
add domain=company2.lan servers=,
and have all queries to <anything>.company1.lan go to, etc. It can't be difficult to implement, can it?
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply. Not intended as incentive for masochists.
Long time Member
Long time Member
Posts: 609
Joined: Thu Jun 02, 2016 4:01 am
Location: Niterói / Brazil

Re: Feature Request: Conditional DNS Forwarding

Fri Sep 14, 2018 5:42 am

That would be great. The number of static entries I have...
User avatar
just joined
Posts: 3
Joined: Sat Sep 22, 2018 2:33 pm

Re: Feature Request: Conditional DNS Forwarding

Sat Sep 22, 2018 4:34 pm

Indeed it would be great!
For reasons, I use an internal DNS server for my local computers domain. At this point, my two MikroTik routers have two home servers as DNS backend which run dnsmasq with conditional forwarding. It would be really nice to shutdown the home servers and only use the MikroTik resolvers.
just joined
Posts: 3
Joined: Tue Jun 26, 2018 8:59 pm

Re: Feature Request: Conditional DNS Forwarding

Mon Sep 24, 2018 11:20 pm

This feature will be very helpful
Posts: 25
Joined: Sun Jun 20, 2010 1:46 pm
Location: Russia, Novosibirsk

Re: Feature Request: Conditional DNS Forwarding

Thu Sep 26, 2019 7:46 am

A very useful feature.
Still, add srv (and other) entries, at least through the console.
ROS: 6.[latest]

Who is online

Users browsing this forum: pacman88, topmktwww and 77 guests