Community discussions

MikroTik App
 
Melfway47
just joined
Topic Author
Posts: 1
Joined: Sun Jun 27, 2021 3:40 am

Static DNS: Does Regex + CNAME work?

Sun Jul 25, 2021 8:07 pm

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
 
popicool
just joined
Posts: 1
Joined: Wed Dec 15, 2021 7:43 pm

Re: Static DNS: Does Regex + CNAME work?

Wed Dec 15, 2021 7:46 pm

I have the same issue
 
fastlorenzo
just joined
Posts: 1
Joined: Mon Jan 24, 2022 1:28 am

Re: Static DNS: Does Regex + CNAME work?

Mon Jan 24, 2022 1:29 am

Same here, it looks like a bug.
Regexp works with A but not when using CNAME
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Static DNS: Does Regex + CNAME work?

Tue Jan 25, 2022 6:21 am

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.
 
groner
just joined
Posts: 3
Joined: Sat Jan 22, 2022 4:11 am

Re: Static DNS: Does Regex + CNAME work?

Tue Apr 05, 2022 8:15 pm

I'm running into this too.

Could this limitation be documented at least? That would have saved me some time today.
 
losty
just joined
Posts: 9
Joined: Sat May 26, 2018 2:27 am

Re: Static DNS: Does Regex + CNAME work?

Sat Oct 29, 2022 3:52 pm

Um... same here... :-(

Tested v6.49.6 + v6.49.7 with no luck. Anyone checked with v7?
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Static DNS: Does Regex + CNAME work?

Sat Oct 29, 2022 7:16 pm

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

Who is online

Users browsing this forum: almdandi, baragoon, Bing [Bot], GoogleOther [Bot], HugoCar, loloski, pajapatak and 68 guests