Thu Dec 10, 2009 6:20 am
It would consume resources, no doubt.
Here is an idea though:
1 - Since the Mikrotik is aware of when config is added, or changes, or deleted, it could have an internal "table" of places throughout RouterOS where a hostname is entered. This would save on resources, as the Mikrotik wouldn't have to "search" for entries throughout RouterOS containing a hostname.
2 - Since IPv4 and IPv6 have a standard structure, it would be easy to validate an IP or non-IP entered in a field.
3 - An internal command could run at a configured time interval (1s, 2s, 5min, etc...) to resolve hostname entries throughout the Mikrotik (it would know which entries have hostname from #1 above).
4 - At #3 interval, the Mikrotik could scan through it's internal table and try to resolve hostnames that are entered.
5 - If it's a hostname, it looks up it's local DNS cache (whether DNS is on or not, it would always have a cache), and if it can't find it, it resolves via external DNS servers, which then get's cached locally for dns ttl value.
I agree, that RouterOS works at layer 3, but it does run on linux, and scripts have been made to do the above already. If it was integrated, though it would be much nicer. As mentioned, this is a popular feature, and other systems do include it.
To start, you could include an option "allow hostname entry" or something in /ip dns set. If this value is "off", no DNS resolving would exist. If it's "on", then the internal program would run to resolve dns hostnames. This would give users a chance to test to functionality and make suggestions. You could start simple, and only add it to specific areas of RouterOS.