liveBook · Manning

Dns message

As explained in Rust in Action: Systems programming concepts and techniques

A DNS message is a structured network packet used to carry a DNS query or response.

A DNS message is a container for requests to DNS servers and responses to clients. It must include a header, while additional fields are optional. A structured message can be converted into bytes for transmission and reconstructed from received bytes. section 8.4.2

Constructing a query

A Rust resolver creates a Message, assigns a random identifier, marks it as a query, adds an IPv4 address query for a domain name, enables recursion, and sends the serialized bytes across the network. section 8.4.2

How Rust in Action: Systems programming concepts and techniques covers it

How deep it goes
Defines message structure and construction flow, but does not cover the full range of DNS options, types, and subtypes.
Examples
Uses a Rust Message containing an IPv4 address query for a supplied domain name.
What it assumes
Assumes familiarity with domain names and IPv4 address lookup while introducing DNS message terminology through code.
What you can do after
Apply it via trust-dns to construct, serialize, send, decode, and inspect a DNS resolver message.
How it connects
Connects DNS queries and responses through headers, domain names, record types, and binary serialization.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust in Action: Systems programming concepts and techniques. The section links point to the parts of the book it draws on.