Static DNS and RegExp

Has anybody experience with RegExp in Static DNS ?
In my opinion it does not work - I have even tried .*\.example\.com from http://wiki.mikrotik.com/wiki/Manual:IP/DNS without success

/ip dns static add address=1.1.1.1 name=".+\\.e\\.com"

will give me output of:

$ dig aghj.e.com @cap

; <<>> DiG 9.9.5-4.3-Ubuntu <<>> aghj.e.com @cap
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2901
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 11

;; QUESTION SECTION:
;aghj.e.com.                    IN      A

;; ANSWER SECTION:
aghj.e.com.             86400   IN      A       1.1.1.1

this will match e.com as well as asdf.e.com etc.

/ip dns static address=1.1.1.1 name=".*\\.\\?e\\.com"
1 Like

Sorry - my fault. I have public DNS (not router) as my default one :slight_smile:

that is why i like dig command so much, so i can set address of DNS server myself.

https://wiki.mikrotik.com/wiki/Manual:IP/DNS#Static_DNS_Entries