Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    caresIssues and PRs related to the c-ares dependency or the cares_wrap binding.confirmed-bugIssues and PRs for confirmed bugs.dnsIssues and PRs related to the dns subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions