Why can't my machine resolve local windows hostnames?

When I ping any local windows hostname from my Ubuntu machine I get "unable to resolve host", but when I ping from a windows machine it works fine. Why would this be? Samba & Miredo are installed


Solution 1:

To ping a netbios name in Ubuntu you need to add wins to /etc/nsswitch.conf. Run:

gksu gedit /etc/nsswitch.conf

And add wins to the line:

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

So it looks like this:

hosts:          files mdns4_minimal [NOTFOUND=return] dns wins mdns4

Save the file, close the text editor, and ping away.

If that does not work, open /etc/samba/smb.conf, and uncomment the "name resolve order" line:

name resolve order = wins lmhosts bcast

after that, restart nmbd smbd winbindd.

Solution 2:

Running apt-get install winbind fixed it for me.