is it dns? / wiki ← back to the live monitor

🧱 The OSI model: where DNS lives, and what's underneath

Before DNS makes sense, you need a picture of the layers it sits on. When DNS misbehaves, the cause is almost always in a layer below it. This page is the map.

The 7 layers, in 60 seconds#

#LayerWhat it movesExampleWhat it answers
7ApplicationDataDNS, HTTP, SSH, SMTP"What does the program want?"
6PresentationEncoded dataTLS, character encodings"What does the data mean once decoded?"
5SessionConversationsLess relevant on TCP/IP networks"Are we still talking?"
4TransportSegmentsTCP, UDP, QUIC"Did it arrive, and in order?"
3NetworkPacketsIPv4, IPv6, ICMP"How do I route this across networks?"
2Data linkFramesEthernet, ARP, 802.1Q VLAN tags"How do I hand this to the next hop on this wire?"
1PhysicalBitsCopper, fiber, radio"Is the cable plugged in?"

The OSI model is a teaching abstraction. The real TCP/IP stack collapses 5/6/7 into one "Application" layer in practice (RFC 1122 defines just four layers: application, transport, internet, link). But the seven boxes are still the language people use to point at where something is broken, and that's why you learn it.

Where DNS lives: and what it depends on#

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  L7  Application  β†’  DNS                      β”‚   "dig example.com"
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  L6  Presentation β†’  TLS (for DoT / DoH)      β”‚   only when encrypted
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  L4  Transport    β†’  UDP/53 (or TCP/53)       β”‚   most queries are UDP
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  L3  Network      β†’  IP (v4 or v6) routing    β”‚   resolver must be reachable
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  L2  Data link    β†’  Ethernet + VLAN tag      β”‚   right port, right VLAN
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  L1  Physical     β†’  cable / Wi-Fi            β”‚   the cable is in
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

A DNS query is a tiny application-layer message that has to ride every layer below it to reach a resolver. Any of those layers can swallow it silently:

  • L1 down: no link, no DNS.
  • L2 wrong VLAN: frame is dropped at the switch port. Resolver looks unreachable. See foundations-layer2 and foundations-vlans.
  • L3 no route: traceroute to the resolver dies before it arrives.
  • L4 firewall blocks port 53: every query times out. The subtler variant: UDP/53 is open but TCP/53 is blocked, so everything works until a response is too big for UDP (truncation forces a retry over TCP) or a zone transfer is needed. RFC 7766 requires DNS implementations to support both transports; firewalls that allow only UDP/53 are misconfigured.
  • L6 TLS mismatch: DoT/DoH negotiation fails; plain Do53 on port 53 still works, which confuses the picture.
  • L7 server returns SERVFAIL: the only one that's actually DNS. See dnssec if the failure is DNSSEC-related.

This is why old hands debug bottom-up. Cable β†’ VLAN β†’ IP β†’ port β†’ DNS. Each step takes seconds. Starting at L7 and working down is how you lose an afternoon.

The "is it DNS?" loop, layered#

The three-stage incident (it's not DNS Β· there's no way it's DNS Β· it was DNS) is funny precisely because everyone reaches for L7 first. The wiki's whole premise is: once you can prove which layer broke, you stop guessing.

   "DNS is broken"
        β”‚
        β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ Is L1 up?       ─ ip link, cable, Wi-Fi    β”‚
   β”‚ Is L2 right?    ─ correct VLAN, ARP works  β”‚
   β”‚ Is L3 reachable? ─ ping the resolver       β”‚
   β”‚ Is L4 open?     ─ nc -z resolver 53        β”‚
   β”‚ Does DNS work?  ─ dig @resolver isitdns.netβ”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚
        β–Ό
   one of those said "no", that's the layer

Here is what each step looks like as an actual command, using 1.1.1.1 as a stand-in for your resolver:

L3: can you reach the resolver at all?

ping -c 3 1.1.1.1

L4: is port 53 open? (TCP probe)

nc -z 1.1.1.1 53

For UDP/53 specifically, nc -u reports success even on a closed port on most systems because UDP is connectionless. Use a real DNS round-trip instead:

dig @1.1.1.1 example.isitdns.net +tries=1 +time=2

If this returns a response, UDP/53 is open and the resolver is answering. The expected answer is a single A record, 192.0.2.1: a documentation address (RFC 5737) that resolves on purpose but routes nowhere, so the lookup is safe to run anywhere. See ip-address-spaces for why this wiki's example records work that way. If the query times out, port 53 UDP is blocked somewhere between you and the resolver.

nslookup cannot probe individual layers. Use nc for TCP L4, dig for UDP L4, ping for L3.

L7: does DNS respond correctly?

dig @1.1.1.1 isitdns.net A
nslookup -type=A isitdns.net 1.1.1.1

If ping and nc both succeed but dig fails, the problem is at L7. If ping fails, look at L3 routing or L2 VLAN config. If dig returns SERVFAIL, retry the same query with +cd (checking disabled): if the +cd retry succeeds, the network path is fine and you are looking at a broken dnssec chain on a validating resolver, not a network problem. (A SERVFAIL never carries the ad flag, so the flag's absence tells you nothing there.)

What lives at each layer (typical DNS-serving environment)#

A concrete map you can point at when something breaks:

LayerWhat you'll usually find
L7The DNS server itself: authoritative, recursive, or both. Could be a home router's built-in resolver, an open-source DNS server, or a commercial DNS appliance. See query-types for the resolver role breakdown.
L6TLS terminations for DoT (:853) and DoH (:443). DoQ folds its TLS 1.3 into the QUIC layer itself, so no separate L6 TLS step is visible to a troubleshooter.
L4UDP/53 + TCP/53 for classic DNS (both are mandatory per RFC 7766), TCP/853 for DoT (RFC 7858), UDP/853 for DoQ (RFC 9250), TCP/443 for DoH (RFC 8484), or UDP/443 when DoH rides HTTP/3
L3IPv4 + IPv6 routing to the resolver, public or private addressing. See ip-address-spaces for the address ranges you'll encounter.
L2Ethernet with 802.1Q VLAN tagging if the network is segmented. See foundations-layer2 for the full L2 picture.
L1Whatever copper, fiber, or radio link the resolver actually sits on

Rule of thumb#

If your DNS troubleshooting starts with "let me check the zone file," ask first: is the resolver reachable? Half the time the zone is fine and the path is broken.

See also#