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

オープン 初心者向け
#2,533 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
swift
領域
networking

調査の方向性

issueに記載された Sources/DNSServer/Handlers/NxDomainResolver.swift から始め、NXDOMAIN応答の構築方法と ttl の使用方法を調べてください。DNS応答テストで、権威レコードとネガティブキャッシュがカバーされているか確認してください。NXDOMAIN応答に短い最小TTLを持つSOAが含まれ、回帰がテストでカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Swift
スター
51.9k
フォーク
1.8k
平均マージ
2日 3時間
マージ済み PR(30日)
27

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apple/container のほかの issue

apple/container の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。