首页  编辑  

Ping 支持机器名

Tags: /计算机文档/Linux & Unix/   Date Created:

通过机器名进行ping:

修改/etc/nsswitch.conf,找到hosts: 行。

改成类似下面:

hosts: files wins dns

wins在dns前面就会自动搜索局域网优先于dns服务器。

http://www.linuxquestions.org/questions/linux-networking-3/ping-netbios-names-from-linux-samba-271336/

the part of interest would be

"...and the "wins" parameter needs to be added to the "hosts:" line in the /etc/nsswitch.conf file"

so then...

grab you favorite editor

edit your /etc/nsswitch.conf file

search for the line starting with hosts (my line was like this "hosts: files dns")

add "wins" to the line ("hosts: files dns wins")