I've got up to the point where I'm carrying over my internal host names into the static DNS entries, however RouterOS seems to be both more limiting but more powerful - and definitely more frustrating here.
I need two entries for each single IP address, simple "hosts" file functionality equivalent to:
192.168.1.1 router.mydomain.com router
(this is what ClearOS and any ordinary "hosts" file would use, and would resolve both "router" and "router.mydomain.com" to the correct IP address).
Now, without entering in two entries per host (I have a lot of hosts so this is not feasible - and no I'm not setting up a separate DNS server) I understand that under RouterOS I need to use a regular expression to do this. I would think that the following would be correct:
/ip dns static> add address=192.168.1.1 name="router(\\.mydomain\\.com)\?"
but when I add this, it's not recognised as a regular expression:
Code: Select all
[admin@router2] /ip dns static> add address=192.168.1.1 name="router(\\.mydomain\\.com)\?"
[admin@router2] /ip dns static> print
Flags: D - dynamic, X - disabled, R - regexp
# NAME ADDRESS TTL
0 router(\.mydomain\.com)? 192.168.1.1 1d
If I use the example provided on the documentation page http://wiki.mikrotik.com/wiki/Manual:IP ... NS_Entries it seems to at least recognise that entry as a regexp:
Code: Select all
[admin@router2] /ip dns static> add address=192.168.1.1 name=".*\\.example\\.com"
[admin@router2] /ip dns static> print
Flags: D - dynamic, X - disabled, R - regexp
# NAME ADDRESS TTL
0 router(\.mydomain\.com)? 192.168.1.1 1d
1 R .*\.example\.com 192.168.1.1 1d
RouterOS agrees that it is a regular expression rather than a regular host name?
Incidentally, lookup against the non-regexp-recognised entries does not work:
Code: Select all
[admin@router2] /ip dns static> /ping router
HOST SIZE TTL TIME STATUS
67.215.65.132 56 49 181ms
67.215.65.132 56 49 180ms
sent=2 received=2 packet-loss=0% min-rtt=180ms avg-rtt=180ms max-rtt=181ms
[admin@router2] /ip dns static> print
Flags: D - dynamic, X - disabled, R - regexp
# NAME ADDRESS TTL
0 router(\.mydomain\.com)? 192.168.1.1 1d
1 R .*\.example\.com 192.168.1.1 1d
2 router|router\.mydomain\.com 192.168.1.1 1d
Code: Select all
[admin@router2] /ip dns static> add address=192.168.1.1 name=".router(\\.mydomain\\.com)\?"
[admin@router2] /ip dns static> print
Flags: D - dynamic, X - disabled, R - regexp
# NAME ADDRESS TTL
0 R .router(\.mydomain\.com)? 192.168.1.1 1d
[admin@router2] /ip dns static> /ping router
HOST SIZE TTL TIME STATUS
67.215.65.132 56 49 180ms
67.215.65.132 56 49 180ms
sent=2 received=2 packet-loss=0% min-rtt=180ms avg-rtt=180ms max-rtt=180ms
Am I missing something, or is this functionality not quite right?