#mdns #dns-sd #zeroconf #agnostic #dns-server #async-mdns

no-std agnostic-mdns

Simple and lightweight mDNS client/server library for any async runtime

5 unstable releases

new 0.3.2 Mar 7, 2025
0.3.1 Mar 4, 2025
0.3.0 Jan 30, 2025
0.2.0 Jan 29, 2025
0.1.1 Jan 11, 2025

#855 in Network programming

Download history 231/week @ 2025-01-10 21/week @ 2025-01-17 165/week @ 2025-01-24 120/week @ 2025-01-31 6/week @ 2025-02-07 2/week @ 2025-02-14

218 downloads per month

MIT/Apache

150KB
3.5K SLoC

Agnostic mDNS

Simple and lightweight mDNS client/server library for any async runtime.

Port HashiCorp's mdns to Rust.

github LoC Build codecov

docs.rs crates.io crates.io license

Introduction

Simple and lightweight mDNS client/server library for any async runtime. 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.3", features = ["tokio"] }
    
  • async-std

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

    [dependencies]
    agnostic-mdns = { version = "0.3", 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

~10–40MB
~611K SLoC