[Bug]: Host DNS NXDOMAIN has no SOA, so macOS caches it and a re-created cluster name stays unresolvable

Đang mở Phù hợp với người mới
#2,533 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
swift
Lĩnh vực
networking

Hướng nghiên cứu

Bắt đầu với Sources/DNSServer/Handlers/NxDomainResolver.swift, được nêu trong issue, và kiểm tra cách nó tạo phản hồi NXDOMAIN cũng như sử dụng ttl. Kiểm tra xem các bài kiểm thử phản hồi DNS có bao phủ bản ghi thẩm quyền và bộ nhớ đệm âm hay không. Công việc hoàn tất khi phản hồi NXDOMAIN có SOA với TTL tối thiểu ngắn và có bài kiểm thử bao phủ lỗi hồi quy.

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

Mô tả

I have done the following
  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project (reproduced on the 1.7.1 release)
Steps to reproduce
  1. Create cluster demo, then delete it.
  2. Look up demo.test from the Mac while it doesn't exist (e.g. kubectl with the old kubeconfig): NXDOMAIN.
  3. Re-create cluster demo.
  4. kubectl get nodes with the new kubeconfig.
Problem description

Step 4 fails with dial tcp: lookup demo.test: no such host for minutes (two attempts in a row), while container cluster list --nodes shows the node running with an IP. A cluster with a fresh name resolves in 0.05 s.

Likely cause: NxDomainResolver (Sources/DNSServer/Handlers/NxDomainResolver.swift) returns NXDOMAIN without an SOA in the authority section, and its ttl is unused. Per RFC 2308 the negative-cache lifetime is then left to the resolver, and macOS kept it for minutes. Returning an SOA with a short minimum TTL (a few seconds) would bound it.

Seen on an M4 Pro.

Environment
- OS: macOS 27.2.1 (26B131)
- Xcode: n/a (signed release pkg)
- Container: 1.7.1 (a15b460)
Code of Conduct
  • I agree to follow this project's Code of Conduct
Ngôn ngữ chính
Swift
Star
51.9k
Fork
1.8k
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
27

Chuẩn bị môi trường

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.

Issue khác của apple/container

Tất cả issue của apple/container

Issue tương tự

Thêm issue về Swift

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.