Skip to content

dns: Add DNSSEC support #14475

Closed
Closed
@fvdm

Description

@fvdm
  • Version: 8.2.1
  • Platform: 64-bit (OSX 10.17, Ubuntu Server 17.04)
  • Subsystem: dns.js

With today's security requirements and Node.js being an important framework, DNSSEC support and validation are becoming very important for all sorts of applications ranging from API clients to IoT devices.

Node dns.js is missing:

  • Basic support to simply allow RRSIG records in the result, instead it returns an EBADRESP error while the requested resource is perfectly valid.
  • Basic support to request RRSIG records, i.e. a RRSIG rrtype for dns.resolve() and a new dns.resolveRrsig() method.
  • DNSSEC verification, to confirm the returned answer is valid. Perhaps with a new method like dns.setVerify(true) to not cause interface trouble.

I don't know much about the technical part of DNSSEC and how to implement it in Node, but I did notice the results are in line with dig hostname on the shell. For example,

// DNSSEC signed, but works fine
dns.resolve ('myhostname.net', 'A', console.log);
[ '37.97.204.102' ]

is similar to:

$ dig myhostname.net a

;; ANSWER SECTION:
myhostname.net.		1382	IN	A	37.97.204.102

while requesting ANY rrtype returns an error:

// DNSSEC signed, does not work
dns.resolve ('myhostname.net', 'ANY', console.log);

{ Error: queryAny EBADRESP myhostname.net
    at errnoException (dns.js:50:10)
    at QueryReqWrap.onresolve [as oncomplete] (dns.js:236:19)
  code: 'EBADRESP',
  errno: 'EBADRESP',
  syscall: 'queryAny',
  hostname: 'myhostname.net' }

compared to dig with clearly the DS and RRSIG included:

$ dig myhostname.net any

;; ANSWER SECTION:
myhostname.net.		83764	IN	NS	ns1.transip.net.
myhostname.net.		964	IN	A	37.97.204.102
myhostname.net.		83764	IN	DS	1560 7 1 B564B27573CEC3AC428BA606B4656A0CF85F5B2E
myhostname.net.		964	IN	AAAA	2a01:7c8:aac3:41b::1
myhostname.net.		83764	IN	NS	ns0.transip.nl.
myhostname.net.		83764	IN	NS	ns2.transip.eu.
myhostname.net.		83764	IN	RRSIG	DS 8 2 86400 20170730051458 20170723040458 57899 net. nDlnsdcnLynmq7U+wKUYRjV8NBiRo/YcnqtBdM4Sgp8lmNwB6EN97Dbn MpIm+lqnj+r6kWHPQ1fpTZBhBR4qrC+V3WIWaImM0fNVOGaLh3DUgcMn mkXpyJCQmVxcT/0g7F3+tuOuY+/loCe8nQD4gWXizBOO294v1bmPktBB xZ0=

I think that the moment DS and RRSIG records are part of the result Node does not recognize it and thus fails to parse the rest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dnsIssues and PRs related to the dns subsystem.feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions