Makaretu.Dns.Multicast.New 0.31.0

.NET 6.0
dotnet add package Makaretu.Dns.Multicast.New --version 0.31.0
NuGet\Install-Package Makaretu.Dns.Multicast.New -Version 0.31.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Makaretu.Dns.Multicast.New" Version="0.31.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Makaretu.Dns.Multicast.New --version 0.31.0
#r "nuget: Makaretu.Dns.Multicast.New, 0.31.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Makaretu.Dns.Multicast.New as a Cake Addin
#addin nuget:?package=Makaretu.Dns.Multicast.New&version=0.31.0

// Install Makaretu.Dns.Multicast.New as a Cake Tool
#tool nuget:?package=Makaretu.Dns.Multicast.New&version=0.31.0


Build Version docs

Forked from to update dependencies and continue development.

A simple Multicast Domain Name Service based on RFC 6762. Can be used as both a client (sending queries) or a server (responding to queries).

A higher level DNS Service Discovery based on RFC 6763 that automatically responds to any query for the service or service instance.


  • Targets .NET Standard 6.0
  • Supports IPv6 and IPv4 platforms
  • Detects new and/or removed network interfaces
  • Supports multicasting on multiple network interfaces
  • Supports reverse address mapping
  • Supports service subtypes (features)
  • Handles legacy unicast queries and responses, see #61 and #91

Getting started

Published releases are available on NuGet. To install, run the following command in the Package Manager Console

PM> Install-Package Makaretu.Dns.Multicast.New

or using .NET CLI run the following command in the project folder

> dotnet add package Makaretu.Dns.Multicast.New

Usage Service Discovery


Always broadcast the service ("foo") running on local host with port 1024.

using Makaretu.Dns;

var service = new ServiceProfile("x", "_foo._tcp", 1024);
var sd = new ServiceDiscovery();
if (sd.Probe(service))
    // Handle the service conflict

See the example advertiser for a working program.


Find all services running on the local link.

using Makaretu.Dns;

var sd = new ServiceDiscovery();
sd.ServiceDiscovered += (s, serviceName) => { // Do something };

Find all service instances running on the local link.

using Makaretu.Dns;

var sd = new ServiceDiscovery();
sd.ServiceInstanceDiscovered += (s, e) => { // Do something };

See the example browser for a working program.

Usage Multicast

Event Based Queries

Get all the Apple TVs. The query is sent when a network interface is discovered. The AnsweredReceived callback contains any answer that is seen, not just the answer to the specific query.

using Makaretu.Dns;

var mdns = new MulticastService();
mdns.NetworkInterfaceDiscovered += (s, e) => mdns.SendQuery("appletv.local");
mdns.AnswerReceived += (s, e) => { // do something with e.Message };

Async Queries

Get the first answer to Apple TVs. Wait 2 seconds for an answer.

using Makaretu.Dns;

var service = "appletv.local";
var query = new Message();
query.Questions.Add(new Question { Name = service, Type = DnsType.ANY });
var cancellation = new CancellationTokenSource(2000);

using (var mdns = new MulticastService())
    var response = await mdns.ResolveAsync(query, cancellation.Token);
    // Do something


Respond to a query for the service. Note that ServiceDiscovery.Advertise is much easier.

using Makaretu.Dns;

var service = "...";
var mdns = new MulticastService();
mdns.QueryReceived += (s, e) =>
    var msg = e.Message;
    if (msg.Questions.Any(q => q.Name == service))
        var res = msg.CreateResponse();
        var addresses = MulticastService.GetIPAddresses()
            .Where(ip => ip.AddressFamily == AddressFamily.InterNetwork);
        foreach (var address in addresses)
            res.Answers.Add(new ARecord
                Name = service,
                Address = address
  • net-dns - DNS data model and Name Server with serializer for the wire and master file format
  • net-udns - client for unicast DNS, DNS over HTTPS (DOH) and DNS over TLS (DOT)


Copyright © 2018-2019 Richard Schneider (

The package is licensed under the MIT license. Refer to the LICENSE file for more information.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.31.0 710 8/11/2023
0.30.0 1,163 5/5/2023
0.29.0 174 4/13/2023
0.28.0 141 4/12/2023