Package: dnsmasq
Version: 2.85-1

Here is the relevant dnsmasq config on Debian 11.2:

domain=test.example.com
cname=alias.test.example.com,client1.test.example.com
cname=alias.dummy.example.com,client1.test.example.com

"client1" is a dhcp client, and the dnsmasq server IP is 192.168.0.253

The problem is we can't resolve the name "alias.test.example.com",
though we can resolve the name "alias.dummy.example.com" which is out
of the domain "test.example.com".

$ dig -v
DiG 9.16.22-Debian

$ dig @192.168.0.253 alias.dummy.example.com alias.test.example.com
client1.test.example.com

; <<>> DiG 9.16.22-Debian <<>> @192.168.0.253 alias.dummy.example.com
alias.test.example.com client1.test.example.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29718
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;alias.dummy.example.com. IN A

;; ANSWER SECTION:
alias.dummy.example.com. 0 IN CNAME client1.test.example.com.
client1.test.example.com. 0 IN A 192.168.0.70

;; Query time: 20 msec
;; SERVER: 192.168.0.253#53(192.168.0.253)
;; WHEN: Wed Mar 02 17:34:27 UTC 2022
;; MSG SIZE  rcvd: 114

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62870
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;alias.test.example.com. IN A

;; ANSWER SECTION:
alias.test.example.com. 5 IN CNAME client1.test.example.com.

;; Query time: 20 msec
;; SERVER: 192.168.0.253#53(192.168.0.253)
;; WHEN: Wed Mar 02 17:34:27 UTC 2022
;; MSG SIZE  rcvd: 96

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40301
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;client1.test.example.com. IN A

;; ANSWER SECTION:
client1.test.example.com. 5 IN A 192.168.0.70

;; Query time: 16 msec
;; SERVER: 192.168.0.253#53(192.168.0.253)
;; WHEN: Wed Mar 02 17:34:27 UTC 2022
;; MSG SIZE  rcvd: 75

$ dig -t any @192.168.0.253 alias.dummy.example.com
alias.test.example.com client1.test.example.com

; <<>> DiG 9.16.22-Debian <<>> -t any @192.168.0.253
alias.dummy.example.com alias.test.example.com
client1.test.example.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24227
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;alias.dummy.example.com. IN ANY

;; ANSWER SECTION:
alias.dummy.example.com. 0 IN CNAME client1.test.example.com.
client1.test.example.com. 0 IN A 192.168.0.70

;; Query time: 20 msec
;; SERVER: 192.168.0.253#53(192.168.0.253)
;; WHEN: Wed Mar 02 17:34:41 UTC 2022
;; MSG SIZE  rcvd: 114

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12433
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;alias.test.example.com. IN ANY

;; ANSWER SECTION:
alias.test.example.com. 5 IN CNAME client1.test.example.com.

;; Query time: 20 msec
;; SERVER: 192.168.0.253#53(192.168.0.253)
;; WHEN: Wed Mar 02 17:34:41 UTC 2022
;; MSG SIZE  rcvd: 96

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31132
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;client1.test.example.com. IN ANY

;; Query time: 20 msec
;; SERVER: 192.168.0.253#53(192.168.0.253)
;; WHEN: Wed Mar 02 17:34:41 UTC 2022
;; MSG SIZE  rcvd: 59

Reply via email to