Crate agnostic_mdns

Crate agnostic_mdns 

Source
Expand description

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.4", features = ["tokio"] }
  • async-std

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

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

§Examples

Please see examples.

§Pedigree

§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.

Re-exports§

pub use service::Service;
pub use service::ServiceBuilder;
pub use iprobe as netprobe;

Modules§

async_stdasync-std
Types for async-std runtime
error
The error type for the mDNS protocol
service
A builtin service that can be used with the mDNS server
smolsmol
Types for smol runtime
sync
synchronous mDNS server implementation
tokiotokio
Types for tokio runtime
workstealworksteal
Generic asynchronous mDNS implementation for work stealing runtimes

Macros§

format_smolstr
Formats arguments to a SmolStr, potentially without allocating.

Structs§

Label
A DNS name.
QueryParam
How a lookup is performed.
ServerOptions
The options for [Server].
SmolStr
A SmolStr is a string type that has the following properties:

Functions§

hostname
Returns the hostname of the current machine.
is_fqdn
Returns true if a domain name is fully qualified domain name