我看到我回答你的问题有点迟了但是我会留下一个通用的答案,万一其他人偶然发现了这个问题.
我的回答是基于avahi-0.6.32_rc.
Is it possible the computer/avahi daemon/something else is ‘caching’ the result?
是的,avahi-daemon正在缓存查找结果.虽然这似乎没有在功能中明确列出,但avahi-daemon(8)手册页提示:
The daemon […] provides two IPC APIs for local programs to make use of the mDNS record cache the avahi-daemon maintains.
I wish to send out the request packet with EVERY CALL of avahi-resolve-host-name. Is this possible?
是的.相关选项是cache-entries-max(来自avahi-daemon.conf(5)):
cache-entries-max= Takes an unsigned integer specifying how many resource records are cached per interface. Bigger values allow mDNS work correctly in large LANs but also increase memory consumption.
要达到预期效果,您只需设置:
cache-entries-max=0
这将完全禁用缓存并强制avahi-daemon在每个请求上重新发出MDNS数据包,从而使您可以监视它们.
但是,我应该在这里注意,这也会使avahi对于正常使用几乎没用.虽然avahi-daemon将发出查询数据包,但它将无法存储结果,并且每次调用avahi-resolve-host-name(以及其他命令行工具,nss-mdns,D-Bus API ……)都将失败.
@H_404_8@
@H_404_8@
总结
如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
小编个人微信号 jb51ccc
喜欢与人分享编程技术与工作经验,欢迎加入编程之家官方交流群!