Systola.Makaretu.Dns.Multicast
2026.3.12
dotnet add package Systola.Makaretu.Dns.Multicast --version 2026.3.12
NuGet\Install-Package Systola.Makaretu.Dns.Multicast -Version 2026.3.12
<PackageReference Include="Systola.Makaretu.Dns.Multicast" Version="2026.3.12" />
<PackageVersion Include="Systola.Makaretu.Dns.Multicast" Version="2026.3.12" />
<PackageReference Include="Systola.Makaretu.Dns.Multicast" />
paket add Systola.Makaretu.Dns.Multicast --version 2026.3.12
#r "nuget: Systola.Makaretu.Dns.Multicast, 2026.3.12"
#:package Systola.Makaretu.Dns.Multicast@2026.3.12
#addin nuget:?package=Systola.Makaretu.Dns.Multicast&version=2026.3.12
#tool nuget:?package=Systola.Makaretu.Dns.Multicast&version=2026.3.12
net-mdns
Forked from https://github.com/jdomnitz/net-mdns (originally https://github.com/richardschneider/net-mdns) 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.
Note: The DNS-SD client does not have flood protection implemented for backwards compatability. We recommend using Tiny DNS for a fully standards compliant client if a server is not needed. If a server is needed this implementation works well.
Features
- Targets .NET Standard 8.0, 9.0, .NET Framework 4.6.2, 4.8.1 and .Net Standard 2.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 Systola.Makaretu.Dns.Multicast
or using .NET CLI run the following command in the project folder
> dotnet add package Systola.Makaretu.Dns.Multicast
Usage Service Discovery
Advertising
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
else
{
//Begin responding to queries for this service
sd.Advertise(service);
//Notify listeners that the service is now available
sd.Announce(service);
}
See the example advertiser for a working program.
Discovery
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 };
mdns.Start();
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())
{
mdns.Start();
var response = await mdns.ResolveAsync(query, cancellation.Token);
// Do something
}
Broadcasting
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
});
}
mdns.SendAnswer(res);
}
};
mdns.Start();
Related projects
- 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)
License
Copyright © 2018-2019 Richard Schneider (makaretu@gmail.com)
The package is licensed under the MIT license. Refer to the LICENSE file for more information.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- Systola.Makaretu.Dns (>= 2026.3.12)
-
.NETFramework 4.8.1
- Systola.Makaretu.Dns (>= 2026.3.12)
-
.NETStandard 2.0
- Systola.Makaretu.Dns (>= 2026.3.12)
-
net10.0
- Systola.Makaretu.Dns (>= 2026.3.12)
-
net8.0
- Systola.Makaretu.Dns (>= 2026.3.12)
-
net9.0
- Systola.Makaretu.Dns (>= 2026.3.12)
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 |
|---|---|---|
| 2026.3.12 | 96 | 3/12/2026 |