Skip to content
广告 · 本站推荐广告

openclaw dns

管理基于 DNS 的服务发现和 DNS 记录配置,支持 mDNS(多播 DNS)用于局域网内的自动发现。

命令签名

bash
openclaw dns <子命> [选项]

子命令

子命令说明
list列出已配置的 DNS 记录
add添加 DNS 记录
remove删除 DNS 记录
discover运行 mDNS 发现扫描

openclaw dns list

列出所有已配置的 DNS 记录。

bash
openclaw dns list [--json]

输出示例:

RECORD                          TYPE    VALUE               TTL
openclaw.local                  A       192.168.1.10        300
_openclaw._tcp.local            SRV     192.168.1.10:18789  120

openclaw dns add

添加新的 DNS 记录。

bash
openclaw dns add [选项]
选项类型说明
--name <name>string记录名称
--type <type>string记录类型:AAAAASRVTXT
--value <value>string记录值
--ttl <seconds>numberTTL(默认 300

openclaw dns remove

删除指定的 DNS 记录。

bash
openclaw dns remove --name <name> [--type <type>]

openclaw dns discover

运行 mDNS 发现扫描,查找局域网中的 OpenClaw 实例。

bash
openclaw dns discover [选项]
选项类型说明
--timeout <seconds>number扫描超时时间(默认 5
--jsonbooleanJSON 格式输出

扫描输出:

Discovering OpenClaw instances on local network...

INSTANCE             HOST              PORT    VERSION
office-agent         192.168.1.10      18789   1.2.0
lab-agent            192.168.1.25      18789   1.1.5

Found 2 instances (5s scan)

mDNS 支持

OpenClaw 使用 _openclaw._tcp.local 服务类型进行 mDNS 广播。启动守护进程后会自动在局域网中广播服务信息。

示例

bash
# 查看 DNS 记录
openclaw dns list

# 发现局域网实例
openclaw dns discover

# 增加超时时间
openclaw dns discover --timeout 10

# 添加 DNS 记录
openclaw dns add --name "agent.openclaw.local" --type A --value "192.168.1.10"

# 删除记录
openclaw dns remove --name "agent.openclaw.local"

另请参阅

基于MIT协议开源 | 内容翻译自 官方文档,同步更新