DNS
The Domain Name System (DNS) lets apps look up the IP addresses behind names such as `api.example.com`. It also provides other information about domains, including which servers receive their email.
What DNS does
When an app calls https://api.example.com/users, it needs a network address for api.example.com. DNS can supply that address without the app having to hard-code it. The /users path is for the HTTP server, not DNS. Looking up a name and connecting to the resulting address are two separate operations, and either one can fail.
Who answers a lookup?
An app typically asks the operating system to resolve a name. If it needs to make a DNS query, the system usually sends it to a recursive resolver. The resolver returns a cached answer if it has one. Otherwise, it can follow referrals: a root server points it to the .com name servers, and a .com server points it to the authoritative name servers for example.com. An authoritative server answers from the zone data it serves. A resolver can also cache referrals, so it doesn't have to start from the root every time.
Which record do you ask for?
An A record contains an IPv4 address, while an AAAA record contains an IPv6 address. A CNAME makes one name an alias of another; to get an address, the resolver follows the alias. MX records identify the servers that receive email for a domain, NS records name the servers responsible for a DNS zone, and TXT records hold text used for purposes such as domain ownership verification.
Example: moving an API to a new load balancer
After publishing the new address, a backend engineer might query dig api.example.com A and see an answer like this:
api.example.com. 300 IN A 203.0.113.42
The 300 is the TTL (time to live), in seconds. In a cached reply, it shows how much longer the record can normally be reused. Seeing the new address from one resolver doesn't mean everyone sees it: another resolver may still have the old answer cached. If you need a shorter cutover window, lower the TTL far enough in advance for old entries to expire. DNS changes also don't close connections that are already open.
Where it matters in backend work
Public APIs often use DNS to point clients at a load balancer or CDN. Inside a Kubernetes cluster, applications can use DNS names to discover services without tracking individual workloads' IP addresses. When debugging, check which resolver the application uses: your laptop and a production container may get different answers for the same name. A correct DNS answer alone doesn't tell you whether the endpoint accepts connections or whether its TLS certificate is valid.
What to explain in an interview
Expect to walk through what happens before an HTTPS request reaches a server. Start with name resolution and explain where caching can skip network queries. Then explain what happens after DNS: the client uses an address to connect and verifies the server's identity with TLS. Keep those steps separate when describing how you'd investigate a failed request.