3 releases (breaking)

Uses new Rust 2021

0.3.0 Aug 5, 2022
0.2.0 Jul 25, 2022
0.1.0 Jul 23, 2022

#1505 in Network programming

27 downloads per month
Used in dominion-chat

MPL-2.0 license

64KB
1.5K SLoC

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:5454".parse().unwrap())
       .unwrap()
       .serve(Echo);

Client


lib.rs:

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:5454".parse().unwrap())
        .unwrap()
        .serve(Echo);

Client

Dependencies

~230–650KB
~15K SLoC