为了检查 mdnsd 是否处于探测模式,我们使用以下命令来浏览服务并将其输出重定向到一个文件,并且在我们决定 mdnsd 处于探测模式的命令中找到设备的主机名。
用于发布服务的命令
dns-sd -R "Test status" "_mytest._tcp." "local." "22"
使用以下命令浏览服务(在后台运行)
dns-sd -lo -Z _mytest._tcp > /tmp/myfile &
使用 cat 来显示文件的内容。
cat /tmp/myfile
myfile 为空,如果>
替换为tee
,我看到控制台 myfile 上的输出仍然为空。
我无法理解发生了什么。
有没有指点,求助
编辑
只是为了完整性添加输出,我之前错过了添加。
# dns-sd -lo -Z _mytest._tcp local
Using LocalOnly
Using interface -1
Browsing for _mytest._tcp
DATE: ---Tue 25 Apr 2017---
11:09:24.775 ...STARTING...
; To direct clients to browse a different domain, substitute that domain in place of '@'
lb._dns-sd._udp PTR @
; In the list of services below, the SRV records will typically reference dot-local Multicast DNS names.
; When transferring this zone file data to your unicast DNS server, you'll need to replace those dot-local
; names with the correct fully-qualified (unicast) domain name of the target host offering the service.
_mytest._tcp PTR Test\032status._mytest._tcp
Test\032status._mytest._tcp SRV 0 0 22 DevBoard.local. ; Replace with unicast FQDN of target host
Test\032status._mytest._tcp TXT ""