Static DNS: Does Regex + CNAME work?

With regards to regex with CNAMEs: is it broken or am I doing something wrong?

This works:

Router:

/ip dns static> /ip dns static print detail where comment="T E S T"
Flags: D - dynamic, X - disabled
 0    ;;; T E S T
      name="git.home" type=CNAME cname="vm.home" ttl=1d

Console:

$ host git.home
git.home is an alias for vm.home.
vm.home is an alias for vm.server.home.
vm.server.home has address 10.7.30.7

This does not work:

Router:

/ip dns static> /ip dns static print detail where comment="T E S T"
Flags: D - dynamic, X - disabled
 0    ;;; T E S T
      regexp="git\.home" type=CNAME cname="vm.home" ttl=1d

Console:

$ host git.home
Host git.home not found: 3(NXDOMAIN)

Console:

$ drill git.home @router.home
;; ->>HEADER<<- opcode: QUERY, rcode: NXDOMAIN, id: 62729
;; flags: qr rd ra ; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; git.home.	IN	A

;; ANSWER SECTION:

;; AUTHORITY SECTION:

;; ADDITIONAL SECTION:

;; Query time: 0 msec
;; SERVER: 10.9.8.7
;; WHEN: Sun Jul 25 12:29:30 2021
;; MSG SIZE  rcvd: 26

Console:

$ drill CNAME git.home @router.home
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 53056
;; flags: qr rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 2
;; QUESTION SECTION:
;; git.home.	IN	CNAME

;; ANSWER SECTION:
git.home.	86400	IN	CNAME	vm.home.

;; AUTHORITY SECTION:

;; ADDITIONAL SECTION:
vm.home.	86400	IN	CNAME	vm.server.home.
vm.server.home.	86400	IN	A	10.7.30.7

;; Query time: 0 msec
;; SERVER: 10.9.8.7
;; WHEN: Sun Jul 25 12:29:34 2021
;; MSG SIZE  rcvd: 83

I have the same issue

Same here, it looks like a bug.
Regexp works with A but not when using CNAME

It works if you specifically ask for CNAME:

# host -t CNAME git.home 192.168.80.184
Using domain server:
Name: 192.168.80.184
Address: 192.168.80.184#53
Aliases:

git.home is an alias for vm.home.

If you ask for A, regexp with CNAME type is ignored and query is sent to upstream resolver. And if it’s something like this, not existing in public DNS, you get NXDOMAIN. And yes, it looks like a bug. Not the only one, whole DNS in RouterOS seems kind of unfinished.

I’m running into this too.

Could this limitation be documented at least? That would have saved me some time today.

Um… same here… :frowning:

Tested v6.49.6 + v6.49.7 with no luck. Anyone checked with v7?

No luck with 7.6, but 7.7beta3 is ok (changelog doesn’t mention anything about it).