DNS client for the [Wiznet W5500] SPI internet offload chip.
Please proceed with caution, and review the code before use in a production environment.
This code was developed for one-off hobby projects.
```rust use w5500_dns::{hl::block, ll::Sn, servers, Client as DnsClient, Hostname, Response};
const DNSSOCKET: Sn = Sn::Sn3; const DNSSRC_PORT: u16 = 45917;
let mut dnsclient: DnsClient = DnsClient::new(DNSSOCKET, DNSSRCPORT, servers::CLOUDFLARE, random_number); let hostname: Hostname = Hostname::new("docs.rs").expect("hostname is invalid");
let mut hostname_buffer: [u8; 16] = [0; 16];
let queryid: u16 = dnsclient.aquestion(&mut w5500, &hostname)?; let mut response: Response<_> = block!(dnsclient.response(&mut w5500, &mut hostnamebuffer, queryid))?;
while let Some(answer) = response.next_answer()? { println!("name: {:?}", answer.name); println!("TTL: {}", answer.ttl); println!("IP: {:?}", answer.rdata); } response.done()?; ```
All features are disabled by default.
embedded-hal
: Passthrough to [w5500-hl].std
: Passthrough to [w5500-hl].defmt
: Enable logging with defmt
. Also a passthrough to [w5500-hl].log
: Enable logging with log
..