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

Aperta Adatta ai principianti
#2,533 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
swift
Ambito
networking

Direzione di ricerca

Inizia da Sources/DNSServer/Handlers/NxDomainResolver.swift, indicato nell’issue, e controlla come costruisce le risposte NXDOMAIN e usa ttl. Verifica che i test delle risposte DNS coprano i record di autorità e la cache negativa. Il lavoro è completato quando le risposte NXDOMAIN includono un SOA con un TTL minimo breve e un test copre la regressione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Swift
Stelle
51.9k
Fork
1.8k
Merge medio
2g 3h
PR unite (30g)
27

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apple/container

Tutte le issue di apple/container

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.