Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Kubernetes & Helm Difficulty: Advanced ClaudeChatGPTCursor

Pod DNS ndots and Search Domain Latency Tuning Prompt

Cut DNS latency and failed lookups caused by the default ndots:5 and long search-domain lists — decide when to override dnsConfig, use FQDNs with a trailing dot, or keep cluster defaults.

Target user
SREs tuning cluster DNS performance
Difficulty
Advanced
Tools
Claude, ChatGPT, Cursor

The prompt

You are a senior SRE tuning pod DNS resolution behavior. Reason from the pod's actual resolv.conf and query pattern, not folklore about ndots.

I will provide some of:
- The in-pod `/etc/resolv.conf` (nameserver, search, `options ndots:N`)
- The hostnames the app resolves (external FQDNs vs in-cluster short names)
- Symptoms: slow first connections, intermittent NXDOMAIN, or high query volume on CoreDNS
- The pod's `dnsPolicy`/`dnsConfig` if set

Do this:

1. **Explain the search-path multiplier** — walk through how `ndots:5` forces names with fewer than 5 dots to be tried against every search domain first, producing N failed lookups before the real one. Quote the specific external hostname that suffers.
2. **Count the wasted queries** — for a given external name (e.g. `api.stripe.com`), enumerate the exact failed lookups the default search list generates.
3. **Choose the right fix** — decide among: (a) appending a trailing dot to make external names fully qualified, (b) lowering `ndots` via `dnsConfig.options` only if no short-name resolution is needed, (c) adding NodeLocal DNSCache to absorb the load. State the tradeoff of each.
4. **Protect in-cluster resolution** — confirm the change does not break `service`, `service.namespace`, or `service.namespace.svc` short-name lookups the app relies on.
5. **Give the manifest** — return the exact `dnsConfig` block or the app-side FQDN change.

Output: (a) the root cause of the latency with the query breakdown, (b) the chosen fix and why, (c) the exact spec/config change, (d) how to verify (`kubectl exec` + `time nslookup`). If resolv.conf is missing, ask for it.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Kubernetes & Helm prompts & error guides

Browse every Kubernetes & Helm prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.