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
6 Answers
To ping a netbios name in Ubuntu you need to add wins to /etc/nsswitch.conf. Run:
gksu gedit /etc/nsswitch.confAnd add wins to the line:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4So it looks like this:
hosts: files mdns4_minimal [NOTFOUND=return] dns wins mdns4Save 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 bcastafter that, restart nmbd smbd winbindd.
Running apt-get install winbind fixed it for me.
You may have to install the package libnss-winbind to be able to find windows computers by hostname. Simply installing winbind may not work. See answer.
1Had the same problem, Ubuntu 14.04 trying to access PC with Windows 8. In addition to above recommendation I had to install libnss-winbind
sudo apt-get install libnss-winbindSource:
1If you have edited your /etc/nsswitch.conf file and installed winbind already (libnss-winbind or samba-winbind) and still have problems, you may need to disable your NSCD (Name Service Cache Daemon).
@Spivot +1
sudo apt-get install winbind libnss-winbindsudo vi /etc/nsswitch.confedit:
hosts: files dns wins myhostnamesudo vi /etc/samba/smb.conf
edit:
[global]
wins server = x.x.x.x
name resolve order = hostReboot for best results, or just:
sudo /etc/init.d/samba restart