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
