Networking for operators · core
What happens on curl https and DNS problems
A request has steps: name resolution, TCP connection, TLS, then HTTP. Each step has a tool, and refused and timed out mean different things.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Name resolution follows /etc/nsswitch.conf (usually files, then dns), then /etc/hosts, then the resolver in /etc/resolv.conf. The recursive resolver walks root, the top-level domain, then the domain's name servers, and every level caches by TTL.
- Tools: dig, dig +trace, getent hosts (the same path apps use) and resolvectl query.
- TCP uses a three-way handshake (SYN, SYN-ACK, ACK) to port 443. Refused means a reset came back: the host is up but nothing listens, or a firewall rejects. Timed out means no answer: dropped by a security group, firewall or route.
- Tools for TCP: nc -vz, ss, traceroute -T -p 443, mtr and tcpdump.
- TLS follows the TCP connection: the client checks the certificate chain and the name. openssl s_client shows the chain and dates. HTTP comes last, tested with curl -v.
- dig talks to DNS directly and skips /etc/hosts. An app may use a stale hosts entry, its own cache (the JVM caches lookups) or a local caching daemon.
- A lookup made before a record existed can be cached as NXDOMAIN for the negative TTL from the SOA record. Wait or flush caches.
- Compare both machines: the resolver in resolv.conf, getent output and dig output, including a private zone attached to only one VPC.
The red pen
Common traps: mistake → fix
Mistake: If dig works, the app resolves the name
Fix: apps use nsswitch, hosts and their own caches.
Mistake: Connection refused and timed out mean the same
Fix: refused is a reset, timed out is silence.
Mistake: DNS changes are instant
Fix: TTLs and negative caching delay them.
Easy to hard
Questions interviewers ask, easy to hard
- Walk through curl https://api.example.in/health.
- Which tool checks each step?
- A name resolves on server A but not on server B. Why?
- What is the difference between refused and timed out?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.