nodejs / nodejs/node

dns.resolveSrv returns ECONNREFUSED on Windows since v24.13.0 (still broken in v25.x and v26.x)

Đang mở
#62,326 12 bình luận 19 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
JavaScript
Star
122k
Fork
37.3k
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
283

Mô tả

Version

v24.14.0, v25.8.1

Platform
Microsoft Windows NT 10.0.26200.0 x64
Subsystem

dns (c-ares)

What steps will reproduce the bug?

Run the following script:

const dns = require("dns");

dns.resolveSrv("_mongodb._tcp.mongodb.<your-cluster>.mongodb.net", (err, addresses) => {
  console.log(err ? `error ${err.code}: ${err.message}` : addresses);
});

Run with Node.js >= v24.13.0 on Windows.

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

100% reproducible on Windows.

No special conditions required.

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

The SRV query should resolve successfully and return records.

Example output (Node v24.12.0 and v25.2.1):

[
  {
    name: 'shard-00-00.<your-cluster>.mongodb.net',
    port: 27017,
    priority: 0,
    weight: 0,
    type: 'SRV'
  },
  {
    name: 'shard-00-01.<your-cluster>.mongodb.net',
    port: 27017,
    priority: 0,
    weight: 0,
    type: 'SRV'
  },
  {
    name: 'shard-00-02.<your-cluster>.mongodb.net',
    port: 27017,
    priority: 0,
    weight: 0,
    type: 'SRV'
  }
]

This behavior is consistent with:

  • previous Node.js versions
  • Node.js v25.2.1
  • other platforms (tested on Linux)
What do you see instead?
error ECONNREFUSED: querySrv ECONNREFUSED _mongodb._tcp.<your-cluster>.mongodb.net

This happens consistently even with valid public DNS resolvers configured on the system.

Additional information

This appears related to the issue described in #61435 and the fix in #61453 (commit 17b363a66c).

However, the problem persists on Windows.

From testing:

  • Node.js 24:

    • Last known working version: v24.12.0
    • First broken version: v24.13.0+
  • Node.js 25:

    • Last known working version: v25.2.1
    • Reproducible in all tested versions up to v25.8.1

The issue is 100% reproducible and specifically affects SRV resolution (dns.resolveSrv).

The issue does not occur in earlier versions and is therefore a regression.

This suggests the fix may be incomplete or that the regression was reintroduced.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với việc tái hiện dns.resolveSrv trong issue và so sánh các thay đổi từ commit 17b363a66c và issue #61435, bao gồm cả bản sửa lỗi được theo dõi trong #61453. Tái hiện kết quả ECONNREFUSED trên Windows với các phiên bản Node.js được liệt kê và xác minh rằng các truy vấn SRV lại trả về các bản ghi mà không gây hồi quy trên các nền tảng khác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, node.js
Lĩnh vực
networking
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.