Bonjour / mDNS discovery
Bonjour / mDNS discovery
Section titled “Bonjour / mDNS discovery”OpenClaw 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
Section titled “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
_openclaw-gw._tcpunder a dedicated zone (example:openclaw.internal.). - Configure Tailscale split DNS so your chosen domain resolves via that DNS server for clients (including iOS).
OpenClaw supports any discovery domain; openclaw.internal. is just an example. iOS/Android nodes browse both local. and your configured wide‑area domain.
Gateway config (recommended)
Section titled “Gateway config (recommended)”{ gateway: { bind: "tailnet" }, // tailnet-only (recommended) discovery: { wideArea: { enabled: true } } // enables wide-area DNS-SD publishing}One‑time DNS server setup (gateway host)
Section titled “One‑time DNS server setup (gateway host)”openclaw dns setup --applyThis installs CoreDNS and configures it to:
- listen on port 53 only on the gateway’s Tailscale interfaces
- serve your chosen domain (example:
openclaw.internal.) from~/.openclaw/dns/<domain>.db
Validate from a tailnet‑connected machine:
dns-sd -B _openclaw-gw._tcp openclaw.internal.dig @<TAILNET_IPV4> -p 53 _openclaw-gw._tcp.openclaw.internal PTR +shortTailscale DNS settings
Section titled “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 your discovery domain uses that nameserver.
Once clients accept tailnet DNS, iOS nodes can browse _openclaw-gw._tcp in your discovery domain without multicast.
Gateway listener security (recommended)
Section titled “Gateway listener security (recommended)”The Gateway WS port (default 18789) binds to loopback by default. For LAN/tailnet access, bind explicitly and keep auth enabled.
For tailnet‑only setups:
- Set
gateway.bind: "tailnet"in~/.openclaw/openclaw.json. - Restart the Gateway (or restart the macOS menubar app).
What advertises
Section titled “What advertises”Only the Gateway advertises _openclaw-gw._tcp.
Service types
Section titled “Service types”_openclaw-gw._tcp— gateway transport beacon (used by macOS/iOS/Android nodes).
TXT keys (non‑secret hints)
Section titled “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 runnableopenclawentrypoint)tailnetDns=<magicdns>(optional hint when Tailnet is available)
Debugging on macOS
Section titled “Debugging on macOS”To browse advertised services:
dns-sd -B _openclaw-gw._tcp