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

Open Beginner friendly
#2,533 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
swift
Domain
networking

Research direction

Start with Sources/DNSServer/Handlers/NxDomainResolver.swift, named in the issue, and inspect how it builds NXDOMAIN responses and uses ttl. Check the DNS response tests for coverage of authority records and negative caching. Done means NXDOMAIN responses include an SOA with a short minimum TTL and the regression is covered by a test.

Written by the indexing model from the issue text.

Description

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
Dominant language
Swift
Stars
51.9k
Forks
1.8k
Avg merge
2d 3h
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apple/container

All issues in apple/container

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.