#mdns #dns-sd #zeroconf #dns-server

no-std agnostic-mdns

Async runtime agnostic, simple and lightweight mDNS client/server library in Rust

1 unstable release

new 0.1.1 Jan 11, 2025
0.1.0 Jan 11, 2025

#1592 in Network programming

MIT/Apache

155KB
3.5K SLoC

Agnostic mDNS

Async runtime agnostic, simple and lightweight mDNS client/server library in Rust.

Port HashiCorp's mdns to Rust.

github LoC Build codecov

docs.rs crates.io crates.io license

Introduction

Async runtime agnostic, simple and lightweight mDNS client/server library in Rust. mDNS or Multicast DNS can be used to discover services on the local network without the use of an authoritative DNS server. This enables peer-to-peer discovery. It is important to note that many networks restrict the use of multicasting, which prevents mDNS from functioning. Notably, multicast cannot be used in any sort of cloud, or shared infrastructure environment. However it works well in most office, home, or private infrastructure environments.

Installation

  • tokio

    [dependencies]
    agnostic-mdns = { version = "0.1", features = ["tokio"] }
    
  • async-std

    [dependencies]
    agnostic-mdns = { version = "0.1", features = ["async-std"] }
    
  • smol

    [dependencies]
    agnostic-mdns = { version = "0.1", features = ["smol"] }
    

Examples

Please see examples.

Pedigree

  • This mdns code is port from HashiCorp's mdns implementation.

  • The DNS message encoding/decoding is inspired by miekg's dns implementation.

License

agnostic-mdns is under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

Copyright (c) 2025 Al Liu.

Dependencies

~15–46MB
~743K SLoC