我如何使ubuntu使用samba来parsingwindows主机名?

我有一个Ubuntu 11.04电脑有两个vms:debian和windows xp。 每个虚拟机也有主机连接,所以我可以从主机看到他们没有设置端口转发。

所有的机器都可以使用ip地址互相ping通,但linux机器(ubuntu主机和debian guest)不能ping通windows xp的名称,只能使用'nmblookup'之类的工具或在nautilus中input'smb:// hostname'。 Windows XP可以通过名称ping所有机器。

当然,我必须在smb.conf中丢失一些configuration。 这是我正在使用的当前一个:

[global] workgroup = WORKGROUP server string = %h server (Samba, Ubuntu) name resolve order = bcast host lmhosts wins printing = cups printcap name = cups printcap cache time = 750 cups options = raw use client driver = yes map to guest = Bad User usershare allow guests = Yes usershare max shares = 100 usershare owner only = False 

任何帮助将不胜感激。

这不只是桑巴!

您需要安装Winbind,它还会安装所需的名称服务切换库来执行您正在查找的内容。 如果系统上存在/lib/libnss_winbind ,则只需修改/etc/nsswitch.cfghosts行即可:

 hosts files dns winbind 

关键是winbind线。 这就告诉Linux使用Windows系统进行名称parsing。

和以前的评论一样,但Arch上的东西有点不一样…

首先我确定nmblookup WinXpClientparsing正确的IP和NMBD服务运行等

在arch linux上,我必须安装nss-mdns并编辑/etc/nsswitch.conf

 hosts files dns wins 

(追加主机线胜)

 systemctl enable avahi-daemon.service systemctl restart avahi-daemon.service ping WinXpClient 

它的工作..或检查resolveip WinXpClient