TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
3.84k stars 400 forks source link

Duplicate records in the ANSWER section #795

Closed SivaKesava1 closed 4 months ago

SivaKesava1 commented 7 months ago

Hi,

I have created a simple CNAME loop in a zone as follows:

test.   500      IN      SOA     ns1.outside.edu. root.campus.edu. 3 6048 4000 2419200 6048
test.   500      IN      NS      ns1.outside.edu.
a.test. 500     IN      CNAME       b.test. 
b.test. 500     IN      CNAME       c.test.
c.test. 500     IN      CNAME       a.test.

The response I get through dig is:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35520
;; flags: qr aa ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;a.test.                                IN      A

;; ANSWER SECTION:
a.test.                 500     IN      CNAME   b.test.
b.test.                 500     IN      CNAME   c.test.
c.test.                 500     IN      CNAME   a.test.
a.test.                 500     IN      CNAME   b.test.
b.test.                 500     IN      CNAME   c.test.
c.test.                 500     IN      CNAME   a.test.

Any reason as to why duplicate records are present in the response? And why does it stop after two iterations?

Best, Siva

SivaKesava1 commented 7 months ago

Same case with a DNAME-CNAME-DNAME loop (inspired from Knot test suite https://gitlab.nic.cz/knot/knot-dns/-/blob/master/tests-extra/tests/basic/query/test.py#L218)

zone file is:

test.   500     IN      SOA     ns1.outside.edu. root.campus.edu. 3 6048 4000 2419200 6048
test.   500     IN      NS      ns1.outside.edu.
e.dname-tree.test. 500     IN      CNAME       e.dname.test. 
dname.test. 500     IN      DNAME       dname-tree.test.

response is:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18478
;; flags: qr aa ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;e.dname.test.                  IN      A

;; ANSWER SECTION:
dname.test.             500     IN      DNAME   dname-tree.test.
e.dname.test.           500     IN      CNAME   e.dname-tree.test.
e.dname-tree.test.      500     IN      CNAME   e.dname.test.
dname.test.             500     IN      DNAME   dname-tree.test.
e.dname.test.           500     IN      CNAME   e.dname-tree.test.
e.dname-tree.test.      500     IN      CNAME   e.dname.test.
ShreyasZare commented 4 months ago

Technitium DNS Server v12 is now available that fixes this issue. Do update and let me know your feedback.