Bonjour / mDNS discovery
Clawdia uses Bonjour (mDNS / DNS‑SD) as a LAN‑only convenience to discover an active Gateway (WebSocket endpoint). It is best‑effort and does not replace SSH or Tailnet-based connectivity.Wide‑area Bonjour (Unicast DNS‑SD) over Tailscale
If the node and gateway are on different networks, multicast mDNS won’t cross the boundary. You can keep the same discovery UX by switching to unicast DNS‑SD (“Wide‑Area Bonjour”) over Tailscale. High‑level steps:- Run a DNS server on the gateway host (reachable over Tailnet).
- Publish DNS‑SD records for
_clawdia-gw._tcpunder a dedicated zone (example:clawdia.internal.). - Configure Tailscale split DNS so
clawdia.internalresolves via that DNS server for clients (including iOS).
clawdia.internal. for this mode. iOS/Android nodes
browse both local. and clawdia.internal. automatically.
Gateway config (recommended)
One‑time DNS server setup (gateway host)
- listen on port 53 only on the gateway’s Tailscale interfaces
- serve
clawdia.internal.from~/.clawdia/dns/clawdia.internal.db
Tailscale DNS settings
In the Tailscale admin console:- Add a nameserver pointing at the gateway’s tailnet IP (UDP/TCP 53).
- Add split DNS so the domain
clawdia.internaluses that nameserver.
_clawdia-gw._tcp in clawdia.internal. without multicast.
Gateway listener security (recommended)
The Gateway WS port (default18789) binds to loopback by default. For LAN/tailnet
access, bind explicitly and keep auth enabled.
For tailnet‑only setups:
- Set
gateway.bind: "tailnet"in~/.nelsonmuntz-c/clawdia.json. - Restart the Gateway (or restart the macOS menubar app).
What advertises
Only the Gateway advertises_clawdia-gw._tcp.
Service types
_clawdia-gw._tcp— gateway transport beacon (used by macOS/iOS/Android nodes).
TXT keys (non‑secret hints)
The Gateway advertises small non‑secret hints to make UI flows convenient:role=gatewaydisplayName=<friendly name>lanHost=<hostname>.localgatewayPort=<port>(Gateway WS + HTTP)gatewayTls=1(only when TLS is enabled)gatewayTlsSha256=<sha256>(only when TLS is enabled and fingerprint is available)canvasPort=<port>(only when the canvas host is enabled; default18793)sshPort=<port>(defaults to 22 when not overridden)transport=gatewaycliPath=<path>(optional; absolute path to a runnableclawdiaentrypoint)tailnetDns=<magicdns>(optional hint when Tailnet is available)
Debugging on macOS
Useful built‑in tools:- Browse instances:
- Resolve one instance (replace
<instance>):
Debugging in Gateway logs
The Gateway writes a rolling log file (printed on startup asgateway log file: ...). Look for bonjour: lines, especially:
bonjour: advertise failed ...bonjour: ... name conflict resolved/hostname conflict resolvedbonjour: watchdog detected non-announced service ...
Debugging on iOS node
The iOS node usesNWBrowser to discover _clawdia-gw._tcp.
To capture logs:
- Settings → Gateway → Advanced → Discovery Debug Logs
- Settings → Gateway → Advanced → Discovery Logs → reproduce → Copy
Common failure modes
- Bonjour doesn’t cross networks: use Tailnet or SSH.
- Multicast blocked: some Wi‑Fi networks disable mDNS.
- Sleep / interface churn: macOS may temporarily drop mDNS results; retry.
- Browse works but resolve fails: keep machine names simple (avoid emojis or punctuation), then restart the Gateway. The service instance name derives from the host name, so overly complex names can confuse some resolvers.
Escaped instance names (\032)
Bonjour/DNS‑SD often escapes bytes in service instance names as decimal \DDD
sequences (e.g. spaces become \032).
- This is normal at the protocol level.
- UIs should decode for display (iOS uses
BonjourEscapes.decode).
Disabling / configuration
CLAWDIA_DISABLE_BONJOUR=1disables advertising.gateway.bindin~/.nelsonmuntz-c/clawdia.jsoncontrols the Gateway bind mode.CLAWDIA_SSH_PORToverrides the SSH port advertised in TXT.CLAWDIA_TAILNET_DNSpublishes a MagicDNS hint in TXT.CLAWDIA_CLI_PATHoverrides the advertised CLI path.
Related docs
- Discovery policy and transport selection: Discovery
- Node pairing + approvals: Gateway pairing
