Skip to content

Add mDNS / DNS-SD service discovery browser - #3719

Merged
mergify[bot] merged 80 commits into
BornToBeRoot:mainfrom
MovGP0:feature/mdns-service-discovery
Nov 21, 2026
Merged

mergify[bot] merged 80 commits into
BornToBeRoot:mainfrom
MovGP0:feature/mdns-service-discovery

Conversation

@MovGP0

@MovGP0 MovGP0 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Description

Add a dedicated mDNS / DNS-SD browser for discovering and analyzing printers, scanners, web servers, NAS devices and other services advertised on the local network.

  • Browse all advertised service types or a specific type on a selected network interface over IPv4 and IPv6.
  • Inspect service instances, SRV targets, ports, addresses and TXT metadata in the Services tab.
  • Inspect individual DNS records in the Records tab, with each TXT entry on its own row. Unsupported and private record types retain their raw RDATA rather than being discarded.
  • Track record expiry, goodbye messages and cache-flush updates; support bounded or continuous browsing, search, copy and CSV/XML/JSON export.
  • Register the tool in navigation, settings migration, documentation and the mdns / dnssd run commands.

The implementation adds no new dependencies. Discovery is limited to the selected local link; it does not register services.

Type of change

  • New feature / improvement
  • Documentation / website

How has this been tested?

Windows 11 Pro, build 26300, with .NET SDK 10.0.404:

  • Release application build passed: dotnet build .\Source\NETworkManager\NETworkManager.csproj --configuration Release -p:DisableBeauty=true --no-restore.
  • All 1,025 tests passed with dotnet test --project .\Source\NETworkManager.Tests\NETworkManager.Tests.csproj --configuration Release --no-restore.
  • Tests cover DNS compression and malformed packets, split/out-of-order responses, IPv6 scope IDs, TTL expiry, goodbye/cache-flush behavior, per-entry TXT rows, unknown record types, bounded result sizes, export and run-command target detection.
  • Docusaurus production build passed using Node 22, including the release-data prebuild step.
  • Live discovery found 21 services, including printers and NAS devices, with ports and IPv4/IPv6 addresses resolving.

Checklist

  • The application builds and tests pass on Windows.
  • Feature and run-command documentation are updated.
  • A next-release changelog entry is included.
  • New localization resources are English-only; translations remain managed through Transifex.
  • No third-party source files were changed.

@MovGP0
MovGP0 force-pushed the feature/mdns-service-discovery branch from c4c5da0 to 034ba46 Compare November 16, 2026 19:45
@mergify

mergify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@MovGP0

MovGP0 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Motivation: I was missing this tool while debugging network printer issues. Printers and other network devices announce themself using the Bonjour/mDNS-SD protocol, so beeing able to inspect mDNS SD entries is helpful in those scenarios.

@MovGP0

MovGP0 commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

queue

☑️ Command disallowed due to command restrictions in the Mergify configuration.

Details
  • sender-permission >= write

@BornToBeRoot

Copy link
Copy Markdown
Owner

@MovGP0 thanks - i try to review it this weekend!

BornToBeRoot and others added 23 commits November 18, 2026 23:42
Radar is the icon of the Ping Monitor. SatelliteDish (lucide-static
1.71.0) is used by no other tool. The empty states show the tool icon
like the other tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (M1)

2026.11.15.0 is the latest stable release: its steps (RDAP, scanner
defaults, DNS servers, port profiles, ...) move to UpgradeTo_2026_11_15_0.
UpgradeToLatest only adds the mDNS / DNS-SD application (inserted at its
default position like RDAP before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The application was appended after the obsolete ARPTable, so it was the
last tool in the navigation. The enum is stored by name, so it can be
moved. Docs: sidebar position after Discovery Protocol (was the same as
PuTTY), the tool list of the website and the run command table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Responses with the TC bit were dropped completely. RFC 6762 18.5: the TC
bit must be ignored on reception of multicast responses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- SIO_UDP_CONNRESET off: Windows reports an ICMP port unreachable as a
  connection reset on the next receive of an UDP socket
- Transient receive errors (connection / network reset, message size)
  only lose that datagram
- A failed send (e.g. network temporarily unreachable) skips the
  question, it is asked again later
- One address family that can't be opened or whose receiver failed no
  longer ends the browse; it fails only if all of them failed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Every packet searched the whole cache twice (expire, cache flush) - up
  to 512 packets x 4096 records per tick on a busy network. The cache
  keeps the keys per RRset for the cache flush, expired records are
  removed once per tick.
- A snapshot (services + records) was created every 250 ms even if
  nothing changed. Now only if the cache changed (Version), otherwise once
  per second for the TTL countdown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
While searching, the services were filtered again with a Refresh (reset)
on every flush (4 times per second): the grid re-sorted all rows and
could lose the selection, the expanded details and the scroll position.
Like the IP Scanner: live filtering on the properties that arrive later
(hostname, port, addresses, TXT records), only while searching. A row
raises only its changed properties (not all every second for the TTL).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The snapshots were merged row by row into the sorted views. With up to
4096 records (e.g. the first snapshot on a busy network) WPF inserts
every row with a linear search. Like the Port Scanner: one by one up to
MaxRowChangesOneByOne (changed rows x all rows), above with one
ReplaceAll. Services and records share the merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Discovery stopped when another tool was selected. Like the IP Scanner,
Port Scanner and Discovery Protocol it now continues in the background
(until the duration expires or Stop is pressed); the results are updated
while it is hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Copy of services mixed \n and Environment.NewLine
- The 4096 rows of the Records view were taken in the order of the
  dictionary, so rows could appear and disappear between snapshots

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…anners (M10, M11, M12)

Layout (IP Scanner / Port Scanner):
- Header and one input row: interface (+ reload), service type,
  duration and the Browse / Stop button (ImageWithTextButton, Play / X,
  disabled while the service type is invalid or while stopping)
- Duration is a drop-down like the Discovery Protocol: 10, 30, 60, 120,
  300 s or Until stopped (was a number field whose right border was
  hidden by the button)
- Progress bar of the duration (indeterminate: until stopped / stopping)
- The status message (and its icon) is only shown when there is one
- Result header with Last scan at and the search, counters (services,
  records) below it; empty states only after a browse
- Context menus on the rows: Copy... (submenu with icon) and Export...,
  copy works on all selected rows in view order; no extra Export button

Status messages: canceled by user (stopped before the duration expired)
and errors, like the scanners. The texts for browsing / completed /
stopped are removed (progress bar, Last scan at).

View model: regions, XML docs, command / CanExecute pattern, export and
status handling like the Port Scanner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The settings were at the top of SettingsInfo (before PropertyChanged) and
between Connections and Listeners in GlobalStaticConfiguration. Both after
the Discovery Protocol now, in the format of the other settings. XML doc
for the documentation identifier.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The result had a tab control (Services / Records), used nowhere else
below the input of a tool. The services are the result; the raw DNS
records (also of other owners and unknown types) are shown instead with
the checkbox Raw DNS records in the header, like the raw JSON of the
RDAP. Export follows what is shown.

Columns like the other grids: MinWidth instead of a fixed width, the last
column (IP addresses / value) fills the remaining width with a MinWidth.
TTL moved before the IP addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start (interface, service type, IPv4 / IPv6) and a summary at the end:
packets processed, without records (queries of other hosts, invalid),
dropped (busy link) and records not cached (cache full), to diagnose
"no services found" from the log. Warning once when the cache is full.
MaxRecords instead of the repeated 4096.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…M15)

CreateQuery removed all trailing dots (TrimEnd), also an escaped one of the
last label (a\.. = label "a."): that label was never written and the
question asked for a different name. A name ending with a backslash was
not rejected either. Only an unescaped final dot is handled now, an
unterminated label throws. Found by the new tests (M16).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CreateQuery: empty / too long labels and names, open escapes, escaped
  final dot
- ReadResponse: queries / other opcodes / errors ignored, other classes,
  wrong address length, scope of link-local IPv6 addresses
- Cache: counters, full cache (new records ignored, cached ones
  refreshed), question backoff to 60 s, refresh before expiry, no
  address questions outside .local, stable record order, version on
  cache-flush change, unescaped service names
- Rows: UpdateFrom raises only the changed properties

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A browse with a duration is a scan that ends by itself and continues in
the background (M8). A browse until stopped never ends: it is paused
while another tool is shown, like the auto refresh of other tools, and
resumed when the view is shown again. The browser continues with the
cache of the browse, so the rows are kept, records that expired during
the pause are removed and the due questions are sent right away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like the other refresh buttons (e.g. WiFi adapters): the reload takes at
least ApplicationUIRefreshInterval (in the background), the icon spins
meanwhile and the reload / browse can't be started again. The initial
load and the reload when the view is shown stay immediate (a run command
can browse right after). A reload that finds an interface again removes
the no-interface / failed message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cache and the browser took one service type (or *). They take a list
now (e.g. the types of a service type profile, M20): a PTR question per
type, services of all of them; * includes the others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like the port profiles of the Port Scanner: named lists of service types
(e.g. Printers = _ipp._tcp; _ipps._tcp; ...) in the new settings page
mDNS / DNS-SD (add / edit / delete, F2, Del, double-click). The name can
be entered in the service type input (M21), so it must be unique, without
";" and must not be * or a service type. Default profiles for new
installations; missing ones are added on upgrade. Settings for the
service type history (M21). Docs: settings section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (M21)

Like the ports of the Port Scanner: the input takes *, service types and
/ or service type profiles separated by ";" (e.g. "Printers; _ssh._tcp"),
the list shows the history and the profiles (grouped, with their service
types), Tab completes a profile name, multi-line paste is joined with ";".
The input is added to the history (not a single profile name). The input
and the run command use the same validator (mdns printers). A profile
renamed or deleted since is reported when browsing. The fixed list of
common service types is replaced (they are still probed with *).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BornToBeRoot and others added 27 commits November 19, 2026 01:58
…e read (critical review BornToBeRoot#7)

GetIPv4Properties / GetIPv6Properties were read in one try: an
exception of one address family (e.g. IPv6 partly configured) skipped the
interface, also its working other family. They are read on their own;
the interface is skipped only if no family can be used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(critical review BornToBeRoot#5)

A PTR target "x\\._ipp._tcp.local." (labels "x._ipp", "_tcp", "local")
ended with "._ipp._tcp.local." and was shown as instance "x\\" of
_ipp._tcp (with questions for it). The dot before the type must be
unescaped (even number of backslashes before it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eview BornToBeRoot#1)

The limit of 4096 records applied to all records of the link (reverse
names, other services, PTR TTL 75 minutes): on a busy network the
SRV / TXT / address records of the browsed services were not cached
anymore, the services had no hostname / port / address or were missing.
A full cache still takes the records of the browsed services (PTR of a
browsed type, SRV / TXT of its instances, A / AAAA of their hosts), up to
twice the limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le packet (critical review BornToBeRoot#2)

A label with invalid UTF-8 (e.g. Latin-1 of an older device) or a control
character rejected the whole response: the valid records of other
services in the same packet were lost. Such a label is kept with its
bytes in the presentation format (\\DDD, RFC 1035); CreateQuery reads
\\DDD back, so the questions for the instance ask for the same bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…browse

The prompt appears on the first browse (UDP 5353 is received). If it is
canceled or the network type isn't allowed, a block rule makes the browse
find nothing without an error: how to allow NETworkManager again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…geted review BornToBeRoot#1, BornToBeRoot#2)

The hosts whose addresses are cached in the extra room of a full cache
were the targets of all SRV records (also of services that are not
browsed, cached earlier or in the packet): other traffic could still fill
it. The set was also rebuilt over the whole cache for every packet.
The hosts of the browsed SRV records are counted in Set / Remove; only
the packet's browsed SRV records are read per packet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ted review BornToBeRoot#4)

The .local check of the SRV host was a plain EndsWith: "host\\.local."
(one label under the root) passed and its addresses were asked by
multicast. Same unescaped-dot check as for the instance names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (targeted review BornToBeRoot#5, BornToBeRoot#6)

- A lone high surrogate took the next character (also a "." separator
  or a "\" escape) into the label; a lone surrogate is now invalid.
- \DDD above 255 was read as the digits instead of being rejected
  (RFC 1035); now an invalid name like the other errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…argeted review BornToBeRoot#7)

The per-family fix moved the enumeration of the unicast addresses out of
the try: an exception there failed the whole interface list again
instead of skipping the interface.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(targeted review BornToBeRoot#3)

The Name column only undid the escaped dot and backslash: a name kept as
bytes (\DDD, e.g. Latin-1 of an older device) was shown as "B\252ro"
and couldn't be told apart from a name with a backslash. The escapes are
read back to bytes and decoded as UTF-8, otherwise Latin-1 ("Büro");
names with control characters stay escaped. The full name, hostname and
raw records keep the escaped technical name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lease review B2)

The cache holds up to 2 x MaxRecords records (records of the browsed
services above MaxRecords), but the raw DNS records were cut at
MaxRecords rows in key order: on a busy link the PTR / SRV / TXT /
address rows of a listed service could be missing from the view and the
export. The rows are now limited to MaxRecordRows (= what the cache can
hold); above, the records of the browsed services are kept first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ease review B3)

The old values of a cache-flush RRset were set to expire before the new
records of the packet were checked against the cache limit: with a full
cache, a host that announced a new address lost its old one after one
second and the new one was not cached. The old values are now only
flushed if a new record of the RRset was cached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…se review B4)

DNS names only compare ASCII letters case-insensitively (RFC 4343, RFC
6762 16), other characters of UTF-8 labels exactly. The cache keys used
ToLowerInvariant and the lookups / rows OrdinalIgnoreCase, so two
devices "Büro" and "BÜRO" were merged into one service, and the Kelvin
sign or a dotless i matched "k" / "i" (also in a service type, e.g.
"_Kerberos._tcp" was taken as "_kerberos._tcp"). New
DNSNameComparer (ASCII case only) for the keys, lookups, the service
type and the rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…release review B1)

A request that only fills in the input (run command Shift+Enter,
Start = false) stopped a running browse and nothing was started again.
The request is now kept and filled in when the browse has ended (also a
browse until stopped that is paused while the view is hidden); a later
request that starts a browse replaces it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (release review P1)

Every question was sent as its own packet (up to 256 per tick and
address family) and PTR questions were repeated without known answers,
so every responder sent all its instances again on each repeat. The
questions of a tick are now combined into packets of up to 1232 bytes
(minimum IPv6 MTU, no fragmentation) with compressed names, and each
PTR question carries the cached instances with more than half of their
TTL left (known-answer suppression, RFC 6762 7.1). Known answers that
don't fit with their question alone are left out (answered as before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y second (release review P2)

Packets of up to 64 KB were accepted, and the values of the raw DNS
records (e.g. the hex of a record of an unknown type) were formatted
again for every snapshot (at least once per second, also while the raw
records are not shown): a single device that sends large records could
use hundreds of MB and keep the browse thread busy. Packets larger than
9000 bytes are ignored (RFC 6762 17: must not exceed), also not copied
by the receiver, and the type, values and IDs of the rows are formatted
once per cached record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cache changed (release review P3)

GetQuestions (every 250 ms) and GetServices rebuilt the instances
(service type regex per PTR record), the wanted questions, a lookup of
all records and an SRV scan over the whole cache on every call, also
when no packet arrived. The instances (keys) and the wanted questions
are now rebuilt only when the cache version changed, and the records of
a name are read from the RRset index. Measured with 100 services and
4000 other records: 100 s of browse ticks 506 ms -> 198 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e browse (final review F1)

An A record with RDATA other than 4 bytes (AAAA: 16) is kept as raw data
without an address. Since the services read the addresses from the RRset
index (P3), such a record of the host of a browsed service threw a
NullReferenceException in GetServices and ended every browse on the link
while it was cached. Records without an address are skipped again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inal review F2)

Above MaxRecordRows, the raw DNS records were sorted by their ID
("key|index", ordinal), so the strings of a TXT record were shown and
exported as 0, 1, 10, 11, 2, ... and the order changed when the limit
was crossed. The rows are now ordered by the position of their record
(stable, the strings keep their order), and whether a record belongs to
a browsed service is checked once instead of twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ew F3)

Two requests that start a browse (e.g. "mdns printers", then "mdns web")
both waited for the running browse to end. The second one started its
browse, then the first one continued: it changed the input to its
service types while the second browse was running and replaced the
tracked browse task with a completed one, so a third request was
ignored. Every request now gets a number; after waiting, only the last
one continues (also a later fill in wins over a waiting start).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l review F6)

TryNormalize is called for records of every packet and for the cached
PTR records when the cache changed. It ran two interpreted regexes and
split the name twice (consecutive hyphens, at least one letter). The
rules are now one [GeneratedRegex] in RegexHelper (lookaheads for the
letter and the hyphens), like the other regexes of the application.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CreateQueries built the whole packet again (all questions and known
answers) for every question it tried to add, quadratic in the number of
questions per packet. A QueryBuilder now adds question by question: the
offsets of the question names don't change when a question is added
(the known answers follow the questions and only point to them), so a
question that doesn't fit is removed again. Same packets as before
(compared byte by byte for 300 random sets of questions and known
answers, 2114 packets).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nged (final review F4)

GetRecords sorted the whole cache by key for every snapshot (at least
once per second, also without a change) and, above MaxRecordRows,
created all rows twice and checked every record for the browsed
services again. The records shown, their order and number of rows are
now computed once per cache version; a snapshot only creates the rows
with their TTL. Same rows as before (compared for 2401 snapshots of
random caches, 2337 of them at the row limit); 13.6 ms -> 1.7 ms per
snapshot in that test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…view G1)

A TTL of e.g. 0xFFFFFFFF kept a record for about 136 years: it never
expired, was never asked again and was sent back as a known answer with
that TTL. Such TTLs are treated as zero (RFC 2181 8), like a goodbye.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (third review G2)

GetQuestions (every 250 ms) copied the cached records of every wanted
question into an array before it checked whether the question was due;
with * on a busy link that are thousands of arrays per tick for almost
no due question. The due time is checked first (both checks only skip
the question, the result is the same).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hird review G3)

Known answers that didn't fit in the packet of their question were left
out, so on a busy link (more than about 45 instances of a type) the
devices whose answers were left out answered every question again. They
now follow in packets with only known answers, with the TC bit set on
every packet of the question but the last (RFC 6762 7.2), at most
MaxKnownAnswerPackets (10) packets per question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mergify
mergify Bot merged commit 46b690b into BornToBeRoot:main Nov 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants