Expand description
§Dominion
A crate to implement DNS Servers and clients.
§Server
use dominion::{Server, ServerService, DnsPacket};
use std::net::SocketAddr;
struct Echo;
impl ServerService for Echo {
fn run<'a>(&self, _client: SocketAddr, question: &'a DnsPacket<'a>) -> Option<DnsPacket<'a>> { Some(question.clone()) }
}
Server::default()
.bind("127.0.0.1:5353".parse().unwrap())
.unwrap()
.serve(Echo);
§Client
Modules§
- body
- The body of the DNS packet (Questions and Resource Records)
- header
- The header of the DNS packet
- name
- Domain name structure and funtions
Structs§
- DnsHeader
- A DNS header.
- DnsPacket
- Represents a complete DNS packet.
- Flags
- DNS Flags
- Name
- A domain name represented as an inverted list of labels.
- Question
- A query for a ResourceRecord of the specified QType and Class.
- Record
Preamble - The ResourceRecord preamble. Common data to all resource record types.
- Resource
Record - A description of a resource that can be used as an answer to a question
or to provide additional information in the
authority
oradditional
fields of a DNS packet. - Server
- A DNS server
Enums§
- Authentic
Data - DNSSEC flag to indicate if the data has been cryptographically authenticated
- Authoritative
Answer - Flag to indicate if the answer is authoritative
- Checking
Disabled - DNSSEC flag to indicate if the client has enabled checking of the data.
- Class
- An enumeration of the different available DNS Classes.
- Name
Error - An error was encountered when trying to work with a domain name
- OpCode
- Standard query (0), Inverse query (1), Server status query (2), Notify (4), Update (5), DSO (6)
- Parse
Error - An error was encountered when trying to parse a byte buffer into a DNS packet
- QType
- The type of Question.
- Query
Response - Query (0) or Response (1) packet.
- Record
Data - The ResourceRecord data associated with the corresponding Name.
- Recursion
Available - Flag to indicate if recursion is available by the server.
- Recursion
Desired - Flag to indicate if recursion is desired by the client.
- Response
Code - Response code
- Trun
Cation - Flag to indicate if the packet has been truncated.
- Type
- The type of ResourceRecord.
- Zero
- Reserved, should be 0.
Traits§
- Server
Service - A DNS service, it recieves a DnsPacket as a question and it has to return anotherone as a response.