dominion

Crates.iodominion
lib.rsdominion
version0.4.0
sourcesrc
created_at2022-07-23 08:20:43.722784
updated_at2023-02-03 19:55:23.680017
descriptionBuild DNS clients and servers
homepage
repositoryhttps://github.com/lopukhov/dominion
max_upload_size
id631324
size7,768
(lopukhov)

documentation

README

Dominion

A crate to implement DNS [Server]s 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: DnsPacket<'a>) -> Option<DnsPacket<'a>> { Some(question) }
}

Server::default()
       .bind("127.0.0.1:5353".parse().unwrap())
       .unwrap()
       .serve(Echo);

Client

Commit count: 19

cargo fmt