resolv.conf“search”忽略

我的/etc/resolv.conf文件是相当基本的,像这样:

 # Generated by NetworkManager domain subdomain.example.org search subdomain.example.org nameserver 192.0.2.100 nameserver 192.0.2.200 

据我所知,如果我有一台电脑,说machine1.subdomain.example.org ,search字段允许我只能使用它的名字machine1访问它。 但这是我得到的:

 $ ping machine1 ping: unknown host machine1 $ ping machine1.subdomain.example.org PING machine1.subdomain.example.org (192.0.2.12) 56(84) bytes of data. .../... 

我在Debian上喘气,如何才能使search指令考虑到名称parsing? 这是一个configuration问题? 我必须检查哪些参数?

编辑:这是根据要求/etc/nsswitch.conf的内容:

 # /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc-reference' and `info' packages installed, try: # `info libc "Name Service Switch"' for information about this file. passwd: compat group: compat shadow: compat hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis 

我将删除 networkingpipe理器resolvconf并再次尝试,确认/etc/resolv.conf仍然有正确的内容。 这两个软件包在服务器上是没有位置的,而且在你最不需要的时候,已经知道它们会和networking和dnsconfiguration混杂在一起。 我用 – 清除它们,如果你想要的话,就把它清除掉。 在删除这些软件包并且可能重新启动networking之后,您可能还想validation/ etc / network / interfaces是否仍然正确。

 apt-get --purge remove network-manager resolvconf