dns-server

crates.io version license: Apache 2.0 unsafe forbidden pipeline status

A threaded DNS server library.

Use Cases

Features

Limitations

Example

```rust use permit::Permit; use probratelimiter::ProbRateLimiter; use dns_server::DnsRecord; use std::net::{IpAddr, Ipv6Addr, SocketAddr, UdpSocket};

let permit = Permit::new(); let sock = UdpSocket::bind(SocketAddr::new(IpAddr::V6(Ipv6Addr::UNSPECIFIED), 0)).unwrap(); let addr = sock.localaddr().unwrap(); let responsebytesratelimiter = ProbRateLimiter::new(100000); let records = vec![ DnsRecord::newa("aaa.example.com", "93.184.216.34").unwrap(), DnsRecord::newaaaa("aaa.example.com", "2606:2800:220:1:248:1893:25c8:1946").unwrap(), DnsRecord::newcname("bbb.example.com", "target.foo.com").unwrap(), ]; dnsserver::serveudp( &permit, &sock, responsebytesrate_limiter, &records, ) .unwrap(); ```

Related Crates

Cargo Geiger Safety Report

```

Metric output format: x/y x = unsafe code used by the build y = total unsafe code found in the crate

Symbols: 🔒 = No unsafe usage found, declares #![forbid(unsafecode)] ❓ = No unsafe usage found, missing #![forbid(unsafecode)] ☢️ = unsafe usage found

Functions Expressions Impls Traits Methods Dependency

0/0 0/0 0/0 0/0 0/0 🔒 dns-server 0.1.0 0/0 0/0 0/0 0/0 0/0 🔒 ├── fixed-buffer 0.3.1 0/0 0/0 0/0 0/0 0/0 🔒 ├── multimap 0.8.3 0/0 5/5 0/0 0/0 0/0 ☢️ │ └── serde 1.0.136 0/0 0/0 0/0 0/0 0/0 ❓ │ └── serde_derive 1.0.136 0/0 0/12 0/0 0/0 0/3 ❓ │ ├── proc-macro2 1.0.36 0/0 0/0 0/0 0/0 0/0 🔒 │ │ └── unicode-xid 0.2.2 0/0 0/0 0/0 0/0 0/0 ❓ │ ├── quote 1.0.16 0/0 0/12 0/0 0/0 0/3 ❓ │ │ └── proc-macro2 1.0.36 0/0 0/47 0/3 0/0 0/2 ❓ │ └── syn 1.0.89 0/0 0/12 0/0 0/0 0/3 ❓ │ ├── proc-macro2 1.0.36 0/0 0/0 0/0 0/0 0/0 ❓ │ ├── quote 1.0.16 0/0 0/0 0/0 0/0 0/0 🔒 │ └── unicode-xid 0.2.2 0/0 0/0 0/0 0/0 0/0 🔒 ├── permit 0.1.4 0/0 0/0 0/0 0/0 0/0 🔒 └── prob-rate-limiter 0.1.1 0/0 0/0 0/0 0/0 0/0 🔒 └── oorandom 11.1.3

0/0 5/64 0/3 0/0 0/5

```

Changelog

To Do

Alternatives

License: Apache-2.0