pdns icon indicating copy to clipboard operation
pdns copied to clipboard

When cname itself is found in the cname cache, an exception is thrown directly

Open zjs604381586 opened this issue 8 months ago • 2 comments

  • Program: Recursor
  • Issue type: Bug report

Short description

During DNS iterative resolution, when the child of qname goes out of the network to resolve the cname to its own cname, it will return serverfail and continue the subsequent iterative operation. However, when the child cname is found in the cache to its own, **an exception **will be thrown directly and the resolution will end.

Environment

  • Operating system: Debian 10
  • Software version: recursor 4.9+
  • Software source:

Steps to reproduce

When the authority is configured with the domain name as mentioned above, the resolution of A can be resolved normally. When resolving AAAA, it will directly hit the cname into its own cache and then throw an exception.

Expected behaviour

When parsing AAAA, after finding the child cname to itself, it can be iterated normally without throwing an exception.

Actual behaviour

Throws an exception and parses and returns rcode 2

Other information

domain:aruu.new-gtarms-into.cloudinfiniti.com child domain:new-gtarms-into.cloudinfiniti.com Authoritative analysis: Image

Supplement: Since this case is caused by an authoritative configuration error, I think that when the child's cname is found in the cache and it is yourself, an exception should not be thrown directly to end the parsing. You can return severefail and continue the subsequent iterative parsing. Only when the cname of the qname is yourself should an exception be thrown.

zjs604381586 avatar Sep 02 '25 11:09 zjs604381586

Does #14822 and #15396 have any influence on this behaviour? It would be nice to test against a more recent version.

omoerbeek avatar Nov 03 '25 07:11 omoerbeek

Does #14822 and #15396 have any influence on this behaviour? It would be nice to test against a more recent version.

The problem remains unresolved. My understanding is that the doCNAMECacheCheck function should return rcode 2 for each CNAME returned to itself, rather than throwing an exception, to resolve the issue.

zjs604381586 avatar Nov 11 '25 11:11 zjs604381586