Community discussions

MikroTik App
 
adamgardner2
just joined
Topic Author
Posts: 11
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 foo.bar, forward it to 172.16.0.2 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.
 
Sob
Forum Guru
Forum Guru
Posts: 8214
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=8.8.8.8,8.8.4.4
/ip dns forwarders
add domain=company1.lan servers=10.11.12.13
add domain=company2.lan servers=192.168.89.10,192.168.89.11
and have all queries to <anything>.company1.lan go to 10.11.12.13, etc. It can't be difficult to implement, can it?
Come on people, do you really have to quote full posts? It's annoying and in most cases useless.
 
User avatar
Paternot
Forum Veteran
Forum Veteran
Posts: 939
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
KnechtRootrecht
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.
 
czb123
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
 
TerAnYu
newbie
Posts: 26
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]
 
luca1234567
newbie
Posts: 30
Joined: Tue May 15, 2018 1:27 am
Contact:

Re: Feature Request: Conditional DNS Forwarding

Mon Dec 14, 2020 1:24 am

Waiting for a kind Mikrotik's implementation, thank you.
Best regards
Best regards.
 
Sob
Forum Guru
Forum Guru
Posts: 8214
Joined: Mon Apr 20, 2009 9:11 pm

Re: Feature Request: Conditional DNS Forwarding

Mon Dec 14, 2020 4:14 am

Wait no more, it's in RouterOS since 6.47. In slightly different form (static records named FWD) and more limited (only one server), but it works.
Come on people, do you really have to quote full posts? It's annoying and in most cases useless.
 
pedjas
just joined
Posts: 10
Joined: Sat Nov 21, 2020 1:08 am

Re: Feature Request: Conditional DNS Forwarding

Mon Dec 14, 2020 1:58 pm

Asked years ago. Refused.

All it takes is NS records to be allowed in static DNS so you can set custom NS for specific domain.
 
aoakeley
Frequent Visitor
Frequent Visitor
Posts: 87
Joined: Mon May 21, 2012 11:45 am

Re: Feature Request: Conditional DNS Forwarding

Wed Jan 19, 2022 3:58 am

Wait no more, it's in RouterOS since 6.47. In slightly different form (static records named FWD) and more limited (only one server), but it works.
Well blow me down....

/ip dns static
add forward-to=192.168.0.5 regexp=".*\\.mydomain\\.com\$" type=FWD

This will forward all subdomains of "mydomain.com" to server 192.168.0.5

Who is online

Users browsing this forum: Ahrefs [Bot], tuxtlequino and 28 guests