嵌入式


win7安装mDNS

<p>How to Resolve a Multicast DNS in Windows 2016-03-26</p> <h1>Windows</h1> <p>Multicast DNS (mDNS), also know as <code>zeroconf</code>, allows distributed resolution of computer hostname without a central domain name server. The protocol allows device to discover each other with no configuration needed. This is what Apple devices use to detect printers in the network.</p> <p>OS X supports the mDNS by default, while avahi-daemon provide a mDNS resolution service for the Linux systems.</p> <p>Download Bonjour for Windows</p> <p>Meanwhile, Microsoft does not provide support for this protocol so we have to resort a software named Bonjour provided by Apple. The Bonjour service is bundled with iTunes so you might already have it if you installed iTunes previously. If you prefer not to install iTunes (a pretty huge download), you may download the Bonjour Print Services (~5MB).</p> <p>After the download, extract the executable file with a compression software such as 7-zip or WinRAR. You will find the file Bonjour.msi (32-bit) and Bonjour64.msi (64-bit). Run either the 32-bit or 64-bit installer based on you operating system. Then, you can verify that the Bonjour service is up and running by checking through the Services tab in Windows Task Manager or through running <code>services.msc</code>. <img src="https://www.showdoc.cc/server/api/common/visitfile/sign/c46d3830a9892f0bcbcca937572c8a38?showdoc=.jpg" alt="" /></p> <p>Allow Bonjour through Windows Firewall</p> <p>Make sure Bonjour is allowed through Windows Firewall. <img src="https://www.showdoc.cc/server/api/common/visitfile/sign/bdad028190601b29d16789466cf62150?showdoc=.jpg" alt="" /></p> <h2>linux安装</h2> <pre><code>#centos sudo yum install nss-mdns avahi #fedora sudo dnf install nss-mdns avahi sudo systemctl enable --now avahi-daemon.service</code></pre> <p><code>/etc/nsswitch.conf</code> 控制系统使用哪个服务用于解析,以及它们的顺序。你应该在那个文件中看到这样的一行:</p> <p><code>hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname</code> 注意命令 <code>mdns4_minimal [NOTFOUND=return]</code>。它们告诉你的系统使用多播 <code>DNS</code>解析程序将主机名解析为 <code>IP</code> 地址。即使该服务有效,如果名称无法解析,也会尝试其余服务。</p> <p>如果你没有看到与此类似的配置,则可以(以 root 用户身份)对其进行编辑</p> <ul> <li><strong>设置主机名</strong> <ol> <li>方法1: <pre><code>$ hostnamectl set-hostname castor。</code></pre></li> <li>方法2: 编辑 <code>/etc/avahi/avahi-daemon.conf</code>,删除主机名设置行上的注释,并在那里设置名称。但是,默认情况下,Avahi 使用系统提供的主机名,因此你不应该需要此方法。 接下来,重启 Avahi 守护进程,以便它接收更改:<code>sudo systemctl restart avahi-daemon.service</code></li> </ol></li> </ul>

页面列表

ITEM_HTML