为什么我的本地服务器都没有解析?

nel*_*aro 9 network-manager networking dns dhcp dnsmasq

当我尝试使用 Web 浏览器 ping 或浏览我们在本地网络上托管的某些域名时,它不起作用。然而,dignslookup 会正确返回它们的详细信息。我需要做什么来解决这个问题?

我们本地网络中的 DNS 服务器和 DHCP 服务器在 Windows 客户端上运行良好。

$ ping ns1.domain.local
ping: unknown host ns1.domain.local
aaron@aaron-laptop:~
$ nslookup ns1.domain.local
Server:     127.0.0.1
Address:    127.0.0.1#53

Name:    ns1.domain.local
Address: 172.16.0.254

$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search domain.local

$ nm-tool

NetworkManager Tool

State: connected (global)

- Device: eth0  [Wired connection 1] -------------------------------------------

  IPv4 Settings:
    Address:         172.16.0.93
    Prefix:          24 (255.255.255.0)
    Gateway:         172.16.0.2

    DNS:             172.16.0.254

</pre>

**Added additional info**

As per http://askubuntu.com/a/146310/10998
> For some reason avahi-daemon interferes with name resolver
<pre>
ping ns1
PING ns1.domain.local (172.16.0.254) 56(84) bytes of data.
64 bytes from ns1.domain.local (172.16.0.254): icmp_req=1 ttl=64 time=0.381 ms
Run Code Online (Sandbox Code Playgroud)

nel*_*aro 13

编辑 /etc/nsswitch.conf 文件

cat /etc/nsswitch.conf
...
#hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
hosts:          files mdns4_minimal dns [NOTFOUND=return] mdns4
...
Run Code Online (Sandbox Code Playgroud)

那个变化为我修复了它。mdns是 DNS 服务的一种特殊实现,它比 DNS 更快。它不能正确解析名称,并且从不使用 [NOTFOUND=return] 选项标准 DNS。这对于大多数互联网来说都很好,但由于某种原因,它不适用于我们的办公室解决方案。

通过更改解析以包含 DNS,我现在可以按预期 ping 域控制器。以及我们在本地办公室域上运行的其他服务。

ping ns1.bidorbuy.local
PING ns1.domain.local (172.16.0.254) 56(84) bytes of data.
64 bytes from controler.domain.local (172.16.0.254): icmp_req=1 ttl=64 time=0.394 ms

ping office-blog.domain.local
PING officewebserver.domain.local (172.16.0.252) 56(84) bytes of data.
64 bytes from officewebserver.domain.local (172.16.0.252): icmp_req=1 ttl=64 time=0.914 ms
Run Code Online (Sandbox Code Playgroud)