
mDNS TUI Browser
A terminal-based mDNS service browser built with Rust, using ratatui for the TUI interface. For an alternative running as a desktop app, check out mDNS-Browser.

Table of Contents
Features
- π₯οΈ Interactive TUI: Full terminal UI with keyboard navigation
- π Service Details: Display IP address with interface info, port, and TXT records
- π Real-time Updates: Async architecture for live service discovery
- β
On-demand Verification: Reconfirm a selected service with the mDNS daemon's verify query (RFC 6762 Β§10.4)
- π Live Metrics & Daemon Health: ServiceDaemon and application metrics, socket and multicast-join status per interface, with a warning when binding or joining fails
- ποΈ Service Type Filtering: Browse different service types separately
- π Quick Filter: Typo-tolerant fuzzy search across all service fields, plus status keywords
- π Advanced Sorting: Sort by Host, Type, Name, Port, Address, or Time in both directions
- βοΈ Custom Service Discovery: Specify service types via CLI for hard-to-discover services
- πΎ JSON State Dump: Export complete application state to JSON with Ctrl+J
- π Local Device Highlight: Services advertised by this device stand out with
β marker and green highlighting
- π Smart URL Opening: Open service URLs from TXT records or constructed hostname/IP URLs, with selection popup for multiple URLs
- π§Ύ File Logging: Diagnostics rotate to a platform log file (
--log-file, --log-level), never printing into the TUI
- π Interface-Aware Addresses: Show which network interface an address was seen on in the details pane (
via eth0, %eth0)
Quick Start
cargo run
Build Release Version
cargo build --release
Install from AUR (Arch Linux)
You can install mdns-tui-browser from the Arch User Repository (AUR) using yay:
# Install using yay
yay -S mdns-tui-browser
This will install the latest version from the AUR and handle updates automatically with your regular system updates.
Install using Homebrew (macOS)
You can install mdns-tui-browser via Homebrew:
# Tap the repository first
brew tap hrzlgnm/tap
brew install --cask mdns-tui-browser
Or install directly without tapping:
brew install --cask hrzlgnm/tap/mdns-tui-browser
This will install the latest version from the Homebrew tap and handle updates automatically with brew upgrade.
Install using winget on Windows
You can install mdns-tui-browser from Winget Packages using winget:
# Install using winget
winget install hrzlgnm.mdns-tui-browser
This will install the latest version from Winget Packages and handle updates automatically with your regular system updates.
Install using snap (Linux)
You can install mdns-tui-browser from Snapcraft using snap:
# Install using snap
sudo snap install mdns-tui-browser
This will install the latest version from the snap store and handle updates automatically with snap refresh.
You can find the package on the Snapcraft store.
CLI Options
# Show version
mdns-tui-browser --version
mdns-tui-browser -V
# Show help
mdns-tui-browser --help
mdns-tui-browser -h
# Browse explicit service types, instead of auto-discovery
mdns-tui-browser --service-types "_http._tcp.local.,_ssh._tcp.local."
mdns-tui-browser -s "_printer._tcp.local."
# Browse with shortened service types (auto-completed)
mdns-tui-browser -s "_http,_ssh"
mdns-tui-browser -s "http,ssh"
mdns-tui-browser -s http -s ssh
# Use specific network interfaces
mdns-tui-browser -i en0
mdns-tui-browser --interfaces en0,eth0
# Disable IPv4 or IPv6 mDNS discovery
mdns-tui-browser --no-ipv4
mdns-tui-browser --no-ipv6
# Load state from a JSON file (view-only mode, no browsing)
mdns-tui-browser --load-state state-dump.json
mdns-tui-browser -l state-dump.json
# Log diagnostics to a specific file instead of the platform default
mdns-tui-browser --log-file /tmp/mdns-tui-browser.log
# Record debug-level diagnostics (also captures mDNS library internals)
mdns-tui-browser --log-level debug
Service Types Argument (--service-types/-s)
Service types to browse for (e.g., http, _http._tcp, printer). Auto-completes (_)service, (_)sub, .(_)[tc|ud]p and .local. suffix.
Usage:
- Can be specified multiple times
- Accepts comma-separated list of mDNS service types
- Auto-completes various service type formats automatically
- Examples:
http, _http._tcp, printer
Interfaces Argument (--interfaces/-i)
Network interfaces to use for mDNS discovery (e.g., en0, eth0).
Usage:
- Can be specified multiple times
- Accepts comma-separated list of interface names
- Names are validated against the OS interfaces; an unknown name aborts with the available list
IP Version Flags (--no-ipv4, --no-ipv6)
Disable IPv4 or IPv6 mDNS discovery. Disabling both at once is rejected, unless --load-state is used (view-only mode performs no browsing).
Load State Argument (--load-state/-l)
Load state from a JSON file for inspection (view-only mode, no browsing). See JSON State Dump for details.
Log File Argument (--log-file)
Override the default log file. Diagnostics never print to the terminal while the TUI runs; they are appended to the file and rotated past 5 MiB with 3 backups kept. The cap applies per session: concurrent sessions sharing one log file are not coordinated β one session's rotation can delete records another session is still appending β so give each concurrent session its own --log-file. Default location: $XDG_STATE_HOME/mdns-tui-browser/mdns-tui-browser.log (else ~/.local/state/mdns-tui-browser/mdns-tui-browser.log) on Linux, ~/Library/Logs/mdns-tui-browser/mdns-tui-browser.log on macOS, %LOCALAPPDATA%\mdns-tui-browser\logs\mdns-tui-browser.log on Windows. A bad explicit path aborts startup with a clear error; an unusable default directory disables logging silently.
Log Level Argument (--log-level)
Minimum level recorded to the log file: error, warn, info, debug, trace (case-insensitive). Default: info and above. With debug or trace, the mDNS library's internal records are captured too.
JSON State Dump
The application can export the complete current state to a JSON file for debugging and analysis purposes, and can also load a previously exported state file for inspection.
Usage
Press Ctrl+J in the TUI to trigger a state dump. The file will be saved with an ISO timestamp filename:
20260207T120102.089898-mdns-tui-browser-1.41.2.json
To load a previously exported state file for inspection (view-only mode, no browsing):
mdns-tui-browser --load-state state-dump.json
mdns-tui-browser -l state-dump.json
When loading a state file, no mDNS browsing is performed. The border color changes to a darker color to indicate view-only mode.
Redaction
State dumps are redacted to make them easier to attach to bug reports. Redaction is heuristic: it leaves hostnames, instance names, interface names, the filter query and the log file path untouched and can miss unusual fingerprints, so review a dump before sharing it.
- TXT values that look like tokens, keys or hashes (long, dense, single-token strings such as device IDs, public keys or UUIDs) become
key=*REDACTED*; the key is kept.
- TXT values that are URLs pointing at a publicly reachable host become
key=*REDACTED*. LAN URLs (private IPv4, link-local IPv6, .local, .home.arpa, β¦) stay visible.
- Public IPv6 addresses, in TXT values and in the address list, keep only their first and last hextet:
2003:*REDACTED*:7927.
- Values that become identical once masked are listed only once.
Plain IPv4 addresses and link-local, unique-local, loopback, multicast and documentation (2001:db8::/32) IPv6 addresses are never redacted. An IPv4-mapped IPv6 address (::ffff:a.b.c.d) is masked like other IPv6 addresses when its IPv4 part is public (::ffff:8.8.8.8 becomes 0:*REDACTED*:808) and kept when it is private. The live TUI always shows the full data. Loading a redacted dump with --load-state omits the masked addresses, since they are no longer valid IP addresses.
JSON Structure
The exported JSON contains comprehensive information about the current application state:
{
"metadata": {
"dumpTimestamp": "2026-02-07T00:40:10.950885Z",
"applicationName": "mdns-tui-browser",
"version": "1.41.2"
},
"services": [
{
"host": "my-device.local",
"serviceType": "_http._tcp.local.",
"addresses": ["192.168.1.100"],
"port": 8080,
"txtRecords": ["path=/api"],
"isOnline": true,
"createdAt": "2026-02-07T11:30:00.123456Z",
"updatedAt": "2026-02-07T12:00:00.123456Z",
"lastOnlineAt": "2026-02-07T12:00:00.123456Z",
"sessionHistory": [
{
"startTime": "2026-02-07T00:39:53.820969Z",
"endTime": "2026-02-07T00:39:55.869714Z"
}
]
}
],
"serviceTypes": ["_http._tcp.local.", "_ssh._tcp.local."],
"metrics": {
"daemon_browse": 160,
"daemon_cache_refresh_addr": 0,
"daemon_cache_refresh_ptr": 0,
"daemon_cache_refresh_srv_txt": 0,
"daemon_cached_addr": 45,
"daemon_cached_nsec": 14,
"daemon_cached_ptr": 74,
"daemon_cached_srv": 42,
"daemon_cached_subtype": 1,
"daemon_cached_txt": 42,
"daemon_dns_registry_active": 0,
"daemon_dns_registry_name_change": 0,
"daemon_dns_registry_probe": 0,
"daemon_dns_registry_timer": 0,
"daemon_known_answer_suppression": 0,
"daemon_timer": 5607,
"service_types_discovered": 31,
"services_discovered": 38,
"services_marked_offline": 4,
"services_updated": 14
},
"filters": {
"query": "",
"activeServiceTypes": ["_http._tcp.local."]
},
"sorting": {
"field": "Host",
"direction": "Ascending"
}
}
Controls
- β/β or j/k - Navigate services list
- β/β or h/l - Switch between service types
- H/L - Page through service types
- Ctrl+Home/End - Jump to first/last service type
- PageUp/PageDown or b/f or Space - Scroll services list by page
- Home/End - Jump to first/last service in list
- Enter - Open service URL in browser (shows selection popup when multiple URLs exist)
- v - Verify the selected service (queries the instance with a 5s timeout)
- s - Cycle sort field forward (Host β Type β Name β Port β Addr β Time)
- S - Cycle sort field backward (Time β Addr β Port β Name β Type β Host)
- o - Toggle sort direction (β/β)
- / - Enter quick filter mode (search across all service fields)
- a - Add new service type to browse
- n - Clear current filter
- d - Remove offline services
- D - Clear stale service types (service types with no services)
- m - Show daemon status (sockets, interfaces, multicast joins) and metrics
- Ctrl+J - Dump current state to JSON file (redaction is heuristic, review before sharing)
- Ctrl+Z - Suspend the application (Unix only)
- ? - Toggle help popup
- Shift+β/β or J/K - Scroll service details
- q or Ctrl+c - Quit the application
Mouse
The app captures the mouse while it runs, so the terminal's own text
selection needs Shift held.
- Drag the border between the service types panel and the panes to its right - resize the panel
- Drag the border between the services list and the details pane - resize the services list
- Grabbable borders highlight while pointed at or dragged
- Click a service or service type to select it
- Wheel over a pane scrolls it (services and types move the selection, details scrolls the viewport)
- Wheel scrolls the help and metrics popups while they are open
- While a popup or text input is open, the mouse does nothing behind it
Service Details Controls
- Shift+β/β or J/K - Scroll service details
- β/β - Scroll help content
- r - Open release notes in browser
- Any other key - Close help popup
Quick Filter Mode
When in filter mode (activated with /):
- Enter - Apply filter
- Esc - Cancel filter input
- Backspace - Delete last character
- Any other key - Type search text (case-insensitive)
Matching
The quick filter searches every service field (fullname, host, service type,
subtype, each address, port, and each TXT record) with typo-tolerant fuzzy matching:
- Terms: whitespace-separated terms must all match, in any order; each term must match within a single field
- Fuzzy: a term's characters must appear in order but need not be adjacent (
prn finds printer)
- Typos: terms of four or more characters tolerate one typo if the rest of the term matches closely together (
prinzer finds printer); shorter terms, numbers, and IP-like terms (digits with dots or colons, or hex digits with colons) tolerate none
- Ranking: services where every term appears contiguously come first, in the selected sort order; then fuzzy matches without typos, then matches needing a typo, each closest first with the selected sort breaking ties; the services header then shows
Relevance βΊ before the sort indicator
Status Keywords
The reserved words online, offline, and flapping filter by service status
instead of matching text. They are case-insensitive and combine with each other
and with text terms; every one must hold.
online - Only online services
offline - Only offline services
flapping - Only flapping services (detected based on session history - at least 3 sessions with at least half shorter than 5 minutes)
Examples:
# Press '/' then type:
prn # Show services matching "printer" and similar
online # Show online services
flapping # Show flapping services
online http # Show online services matching "http"
offline printer # Show offline services matching "printer"
online flapping # Show services that are both online AND flapping
online offline # Shows nothing (contradictory status)
Add Service Type Mode
When in add service type mode (activated with a):
- Enter - Add the service type and start browsing
- Esc - Cancel input
- Backspace - Delete last character
- Any other key - Type service type name
The service type is automatically normalized (e.g., http becomes _http._tcp.local.).
Local Device Highlight
Services whose resolved address matches one of this device's network interface addresses are marked as local:
β prefix in the services list plus bold green highlighting, visible even on monochrome terminals or when rows truncate.
β Advertised by this device banner at the top of the service details.
- Interface addresses refresh every 30 seconds, so VPN/DHCP changes are picked up without restart.
- Link-local addresses (
fe80::/10 IPv6, 169.254/16 IPv4) only match on the same interface, so identical addresses on different links are not misflagged.
Opening Service URLs
Press Enter on a service to open its URL. URLs come from two sources, deduplicated:
- TXT records: any
key=http://... or key=https://... value.
- Constructed URLs for service types containing
http: scheme://host:port/path for the hostname plus every resolved IP (IPv6 bracketed, link-local IPv6 skipped). Scheme is https when the service type contains https, otherwise http. Path comes from the path= TXT record when present.
Behavior depends on how many URLs are found:
- No URLs: status message
No URL found for this service.
- One URL: opened directly in the browser.
- Multiple URLs:
Select URL popup with β/β to navigate, Enter to open, Esc or any other key to cancel.
Verifying Services
Press v on the selected service to verify it (RFC 6762 Β§10.4 record reconfirmation): the mdns-sd daemon re-queries the instance's SRV and address records with a 5-second timeout. There is no separate response event; the outcome reads off the service itself, shown in the services list and details pane:
- While the window is open, the service shows a
β» prefix in the list and Verification: in progress in the details pane.
- A service still online when the window closes answered the daemon's queries: it shows a
β prefix and a Verified: line in the details pane. The indication stays until the service goes offline or is verified again.
- A service that does not respond loses its records when the window closes: the daemon flushes them and the service goes offline like a regular removal.
- Multiple services can be verified at the same time; each shows its own marker and resolves independently.
- Verification needs a live daemon and an online service: it is unavailable in view-only mode (
--load-state) and for offline entries.
Service Addresses
The details pane shows which interface each address was seen on (live browsing):
- IPv4:
192.168.1.10 via eth0
- IPv6 link-local:
fe80::1%eth0 (interface index on Windows)
- IPv6 global:
2001:db8::1 via eth0, wlan0
The services list shows only the first address as a bare IP. State dumps do not preserve interface information, so loaded dumps show bare addresses.
Monochrome Mode (NO_COLOR)
Set the NO_COLOR environment variable to any non-empty value (see ) to disable colors. The interface stays fully usable through text attributes instead:
- Selected rows use reverse video.
- Offline services stay struck through, flapping services stay underlined.
- The
β local-device marker, the β»/β verification markers, and the > URL-selection indicator do not depend on color.
Architecture
The application is built with:
- Rust - Systems programming language (Safe Rust only - no unsafe blocks allowed)
- ratatui - Terminal UI framework
- tokio - Async runtime
- crossterm - Terminal handling
- flume - Async channel library for communication
- mdns-sd - mDNS service discovery library
- clap - Command line argument parsing library
- chrono - Date and time handling for local timestamp display
- serde - Serialization framework for JSON export
- serde_json - JSON serialization support
- if-addrs - Network interface enumeration
- nix - Unix system calls (signal handling for Ctrl+Z suspend)
- open - Cross-platform library to open URLs in the browser
- url - URL parsing and validation for URL extraction from TXT records
Safety Policy
This project follows a Safe Rust Only policy:
- No
unsafe blocks are permitted in the codebase
- All memory safety is guaranteed by Rust's compiler and runtime
- The codebase is configured to reject unsafe code
- This ensures maximum security and reliability for the mDNS service browser
Design Notes
- Extensible Design: Built for real mDNS service discovery
Project Structure
src/
βββ main.rs # Entry point with CLI argument handling
βββ daemon_status.rs # Daemon socket/interface status and derived problems
βββ tui_app.rs # Main TUI application logic
βββ input.rs # User input handling (filter, service type)
βββ popup.rs # Popup UI components (help, metrics)
βββ quick_filter.rs # Quick filter query parsing and fuzzy matching
βββ scroll.rs # Scroll state management
βββ status_message.rs # Dismissible messages shown over the UI
βββ models.rs # Data models
βββ terminal.rs # Terminal management
Building
The project uses Cargo for building:
cargo run - Run the TUI application
cargo build --release - Build optimized release version
Build Provenance
Starting from Release 1.6.0, all release assets include cryptographic build provenance attestations generated by GitHub Actions. This provides verifiable evidence that the binaries were built from the official source code repository.
What is Build Provenance?
Build provenance is a cryptographically signed attestation that answers:
- Who built the binary (GitHub Actions)
- What source code was used (specific commit hash)
- How the binary was built (build process and environment)
- When the binary was built (timestamp)
Verifying Release Assets
You can verify the authenticity of release assets using the GitHub CLI:
# Using GitHub CLI
gh attestation verify mdns-tui-browser--Linux-x86_64.tar.gz --repo hrlzgnm/mdns-tui-browser
This ensures that the binaries you download are authentic and haven't been tampered with.
Auditable Builds
Starting from Release 1.6.0, all release binaries are built with cargo-auditable, which embeds detailed dependency information directly into the executable. This provides additional security benefits:
What are Auditable Builds?
Auditable builds embed a complete dependency tree in JSON format within the binary, enabling:
- Security Auditing: Scan binaries for known vulnerabilities in their dependencies
- Supply Chain Transparency: Know exactly which crate versions were used
- Zero Bookkeeping: No separate dependency tracking required
- Production Safety: Verify that production binaries match expected dependencies
How It Works
The cargo auditable command builds your application with additional metadata:
- Embeds JSON-formatted dependency information in a dedicated binary section
- Typically adds less than 4KB even to large dependency trees
- Works across all platforms (Linux, Windows, macOS, WebAssembly)
Auditing Release Binaries
You can audit any release binary to verify its dependencies:
# Install required tools
cargo install cargo-audit
# Extract and audit dependencies from a release binary
cargo audit bin path/to/mdns-tui-browser
Build Process
Release builds use auditable builds by default:
- CI/CD builds: Use
cargo auditable build --release
- Development builds: Use standard
cargo build --release for performance
- Dependency tracking: Automatic, no manual intervention required
This ensures that every release binary can be independently verified for security compliance and supply chain integrity.
Immutable releases
The GitHub releases are now immutable: a release is first created as a draft, all its assets (binaries, checksums, attestations) are uploaded while it is still a draft, and it is only published once everything is in place. This ensures that a published release is always complete and cannot be altered afterward.
This process has been used since release v1.32.0.
Future Enhancements
License
MIT License