Skip to content

Resolving NS records against manual configured servers fails (ENODATA) #33858

Closed
@f3lang

Description

@f3lang
  • Version: v14.4.0
  • Platform: Linux wolfgang-ThinkPad-P51 5.4.0-31-generic net: give better error messages #35-Ubuntu SMP Thu May 7 20:20:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: dns

What steps will reproduce the bug?

First, you need a DNS zone with NS records delegating a subdomain to another DNS zone.
I set up an example on our domain:
root domain: ventx.de
delegated subdomain: delegation-test.ventx.de
The zone ventx.de contains a NS record "delegation-test.ventx.de" with this content:

ns-1926.awsdns-48.co.uk.
ns-670.awsdns-19.net.
ns-282.awsdns-35.com.
ns-1527.awsdns-62.org.

This can be tested with dig delegation-test.ventx.de NS @ns-675.awsdns-20.net, which results in the very same output, so the zone is setup correctly.
For the following description I'll use the IP address of ns-675.awsdns-20.net, which is 205.251.194.163

When you try to replicate this query with nodejs, an ENODATA error is thrown:

Error: queryNs ENODATA delegation-test.ventx.de
    at QueryReqWrap.onresolve [as oncomplete] (dns.js:203:19) {
  errno: undefined,
  code: 'ENODATA',
  syscall: 'queryNs',
  hostname: 'delegation-test.ventx.de'
} undefined

This is the output of the following code-snippet:

const {Resolver} = require('dns');
const resolver = new Resolver();
resolver.setServers(['205.251.194.163']);

resolver.resolve('delegation-test.ventx.de', 'NS', (err, resolve) => {
	console.log(err, resolve);
});

I debugged this also with wireshark and was able to see, that the actual query to the nameserver
is correct and also the response is coming back with the correct recordSet:
image
As you can see, the response has the status "No error", however nodejs throws an ENODATA error.

How often does it reproduce? Is there a required condition?

I was able to reproduce the bug everytime without any other condition

What is the expected behavior?

null [
  'ns-670.awsdns-19.net',
  'ns-282.awsdns-35.com',
  'ns-1926.awsdns-48.co.uk',
  'ns-1527.awsdns-62.org'
]

that's how the output of the snippet looks like, when you to not manually set a server

What do you see instead?

Error: queryNs ENODATA delegation-test.ventx.de
    at QueryReqWrap.onresolve [as oncomplete] (dns.js:203:19) {
  errno: undefined,
  code: 'ENODATA',
  syscall: 'queryNs',
  hostname: 'delegation-test.ventx.de'
} undefined

Additional information

I was also able to reproduce the issue with the node:latest docker container:

 $ node -v
 v14.4.0
 $ uname -a
 Linux runner-6ab0c1ba-project-16-concurrent-0 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 GNU/Linux
 $ node dns_fail.js
 Error: queryNs ENODATA delegation-test.ventx.de
     at QueryReqWrap.onresolve [as oncomplete] (dns.js:203:19) {
   errno: undefined,
   code: 'ENODATA',
   syscall: 'queryNs',
   hostname: 'delegation-test.ventx.de'
 } undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    dnsIssues and PRs related to the dns subsystem.invalidIssues and PRs that are invalid.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions