UDP is a connectionless transport protocol that sends independent datagrams without guaranteeing delivery, ordering, or duplication control. Two-way communication requires each side to act as both client and server. section 8.11
DNS provides a practical UDP use case: a resolver sends a query to a DNS server, which returns an answer containing the requested IP address. DNS can also use TCP and TLS, but UDP is used for DNS requests. section 8.4.2
A small Rust resolver demonstrates the surrounding workflow:
- Resolve the hostname into a domain-name representation, construct a DNS query, and request an IPv4 address. section 8.4.2
- Use Rust's UdpSocket together with trust-dns to exchange and interpret the message. section 8.4.2
Resolve a hostname
Running `cargo run -q -- www.rustinaction.com` produces an IPv4 address such as `35.185.44.232`; the `-s` option selects another DNS server.




