People remember www.schule.example, devices need 192.168.0.3. The Domain Name System translates names into addresses. Every computer has a DNS server configured for this (static or via DHCP) and asks it before opening a connection.
Records
Type
maps
Example
A
name → IPv4 address
web.schule.example A 192.168.0.3
AAAA
name → IPv6 address
web AAAA 2001:db8::3
CNAME
alias → another name
www CNAME web
MX
domain → mail server (with preference)
schule.example MX 10 mail
NS
domain → responsible name server
PTR
address → name (reverse lookup)
TXT
free text
Every record has a TTL: a client may keep the answer in its cache for that long.
How a query works
The browser wants www.schule.example and asks the DNS server (UDP, port 53).
The server finds www as a CNAME for web and the A record for it.
It answers authoritatively with the chain; the client remembers the result.
If the server does not know the zone, it forwards to another DNS server (e.g. the provider’s) and answers “non-authoritative”.
Example names end in .example, a domain that according to RFC 2606 is never assigned.
Recursive and iterative
A PC asks its DNS server recursively: “Give me the finished answer.” The server (resolver) then continues iteratively itself: first a root server, which refers to the servers of the top-level domain, these refer to the responsible server of the domain, and only that one answers with the address (RFC 1034, Section 4.3.1). Every answer has a TTL; it may be cached for that long, and the next question is answered faster.
In leyoNET a DNS server can forward queries it cannot answer itself to another server (forwarder). That corresponds to the resolver that keeps asking on behalf of its clients.
In leyoNET
A server becomes a DNS server under Advanced → Services and gets a zone.
DNS translates names into addresses and back. The client asks its DNS server via UDP port 53 and caches the answer for its TTL (ipconfig /displaydns, ipconfig /flushdns).
A and AAAA: name → IPv4 or IPv6 address
CNAME: alias for another name (the server follows the chain)
MX: mail server of a domain; the smallest preference wins
TXT: text, e.g. an SPF rule
NS: name server of the domain
PTR: address → name (reverse lookup under in-addr.arpa or ip6.arpa)
The server answers names in its own zone authoritatively. With forwarding it asks another server (e.g. the provider's) for all other names and answers “non-authoritative”. Test with nslookup -type=MX school.example, nslookup 192.168.0.3 (PTR) or nslookup name server (ask a specific server).
See an example
DNS with forwarding
School DNS with the zone schule.example (A, CNAME, MX, TXT, NS, PTR) that forwards unknown names to the provider's DNS.
PC 1 resolves an alias through two CNAMEs, looks up the mail server (MX) and opens a page at the provider: the school DNS forwards the question and answers “non-authoritative”.
“Watch live” opens the network in leyoNET, the simulation runs in a loop. In the app you find it under File → Demo networks, with a step-by-step tour.
Practise
★★★☆☆Open a web page via DNS· 3 goals · Worksheet (German)
★★★★☆UE02 network services: web server, DNS and fixed assignments· 19 goals · Worksheet (German)
★★★★☆Protocol analysis – Task 3: ARP, DNS and HTTP· 7 goals · Worksheet (German)
In leyoNET under Tools → Exercise catalogue. Every exercise checks itself.
What leyoNET simplifies
Protocol
Layer
Simplification in the simulation
DNS
7
Records A, AAAA, CNAME (also chains), MX with preference, TXT, NS, PTR (in-addr.arpa, ip6.arpa); authoritative answers from the zone, forwarding to another DNS server with cache (“non-authoritative”), NXDOMAIN, NODATA and SERVFAIL; client cache by TTL; nslookup -type=…. No zone transfer, no DNSSEC, no own recursion via the root servers