🛠️
DEVOPS TIP — Aug 13, 2026DNS Troubleshooting & Caching — Stop Blaming Your NetworkThe problem: Your app can't reach an API by hostname.
nslookup shows a stale record. Frontend blames backend, backend blames DNS, ops blames everyone.
DNS is a chain of resolvers — each with its own cache and TTL:systemd-resolved stub (127.0.0.53)
- Docker embedded DNS
- Go runtime in-process cache
Real commands that actually help:# Check what your system thinks DNS is:
resolvectl status
getent hosts example.com
# Compare upstream vs cached:
dig @8.8.8.8 example.com
dig @127.0.0.53 example.com
# Flush your local DNS cache:
resolvectl flush-caches
# Trace the full resolution chain:
dig +trace example.com
Quick fixes:- Docker: add
dns 8.8.8.8 to your container config
- Kubernetes: use CoreDNS forward zones for internal services
- systemd-resolved:
FallbackDNS=8.8.8.8 1.1.1.1 + Domains=~company.local
💡
Pro tip: Reduce
attempts from 4→2 in systemd-resolved to cut DNS outage hang from 16s to 4s.