Skip to content

dns.resolveMx returns invalid result in Node <22 #53708

Open
@analogic

Description

@analogic

Version

v20.15.0

Platform

linux & docker

Subsystem

dns

What steps will reproduce the bug?

I have this code:

const dns = require('dns');
const ign = dns.resolveMx("blek.cz", (err, addresses) => console.log([err, addresses]));

And results:

$ docker run -ti node:16 node
[ null, [ { exchange: 'blekmx1.blek.cz', priority: 100 } ] ]

$ docker run -ti node:18 node
[ null, [ { exchange: 'blek.cz', priority: 100 } ] ]

$ docker run -ti node:20 node
[ null, [ { exchange: 'blek.cz', priority: 100 } ] ]

$ docker run -ti node:20-alpine node
[ null, [ { exchange: 'blek.cz', priority: 100 } ] ]

$ docker run -ti node:22 node
[ null, [ { exchange: 'blekmx1.blek.cz', priority: 100 } ] ]

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

Might be system/resolver dependent. Also there should be something unusual about this particular domain

What is the expected behavior? Why is that the expected behavior?

$ dig +short mx blek.cz
100 blekmx1.blek.cz.

What do you see instead?

Bare "blek.cz" host even don't have SMTP port open so it makes emails undeliverable

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    caresIssues and PRs related to the c-ares dependency or the cares_wrap binding.confirmed-bugIssues with confirmed bugs.dnsIssues and PRs related to the dns subsystem.v18.xIssues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch.v20.xv20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions