Community discussions

MikroTik App
 
Borizo
newbie
Topic Author
Posts: 40
Joined: Thu Oct 28, 2010 4:38 pm

[Feature][DNS] Apply the regexp entry after plain entries

Thu Oct 20, 2016 6:39 pm

According to Manual:IP/DNS "Regular expressions are checked first, then the plain records.". That unfortunately does not always fits.

Use case (cannot be done with current Mikrotik's DNS):
host1.example.com -> 192.168.0.100
host2.example.com -> 192.168.0.101
.*\.example\.com  -> 192.168.0.250
Proposal: Please add a checkbox for static regexp DNS entries: "Apply this regexp entry after plain entries".
PS Technically it's probably possible to resolve this issue with sophisticated regexp, but it wouldn't be nice solution for long "exclusion" list, especially keeping in mind that regexps are expensive.
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: [Feature][DNS] Apply the regexp entry after plain entries

Fri Oct 21, 2016 2:40 am

In WinBox, the list of static DNS records can be ordered by number (# column) for some reason. So it might be best if entries were checked in this order and users would be free to give priority to whatever they'd want to.

Although it would probably need some global on/off switch for this behaviour, because if someone wouldn't require this functionality, there could be some internal optimizations done for larger lists.
 
Borizo
newbie
Topic Author
Posts: 40
Joined: Thu Oct 28, 2010 4:38 pm

Re: [Feature][DNS] Apply the regexp entry after plain entries

Wed Nov 30, 2016 2:14 am

Glad to see that someone else interested in this feature.
Also I noticed that in new revisions developers has split regular-expressions from plain-text records.
Nice to see that this logical step in new software. Devs, please keep going.
In WinBox, the list of static DNS records can be ordered by number (# column) for some reason.
I suppose that's mostly for a human convinience.
May be for regular expression entries the order has meaning in current implementation (though I have not checked).

The order is most likely not important, becuase (as I suppose) developers have used some kind of std::map or a hash to speed-up lookups among simple text entries.
For a regular expressions you can't use hash and you are forced to do check record-by-record.
I hope it is so as I explained, thus the cost of implementation of the feature "Apply this regexp entry after plain entries" will be small.
 
Xenhat
just joined
Posts: 8
Joined: Fri Dec 30, 2016 9:41 pm

Re: [Feature][DNS] Apply the regexp entry after plain entries

Sat Jul 17, 2021 11:24 pm

I found my way here after searching for this specific feature.
I would be interested in seeing this as well. This would make the Mikrotik DNS server a lot more useful.
My current use case for the RouterOS DNS server calls for this functionality to be present and I find it very puzzling for this to be unanswered so many years later.

Could we see if this is possible?

Who is online

Users browsing this forum: adrianmartin16, almdandi, Amazon [Bot], infabo and 75 guests