How to get Ubuntu to ping a Windows hostname (and vice-versa)

I’m currently running ubuntu server in a virtual machine on my pc, and one of the annoying problems I’ve always had with ubuntu is that it never seems to be able to resolve the hostnames of machines running windows.

After a little bit of digging I found a really simple solution in this forum topic

All you have to do is:

sudo nano /etc/nsswitch.conf

change the line that says

hosts: files dns

to this:

hosts: files wins dns

(order does matter)

finally, you need to install winbind

sudo apt-get install winbind

To enable windows to ping ubuntu you then need to install samba:

sudo apt-get install samba
This entry was posted in Computing and tagged . Bookmark the permalink.
  • Server14177

    this don´t work.  thanks

  • Chris

    Worked on ubuntu 12.10 – Thanks

  • Kaismh

    Great Post, works on Kubuntu 12.10

  • ken

    Manh, I was scratching my head out.  I found you site and voila.  I have Ubuntu 12.xx.
    Thank you.

  • toni

    Damn thanks man you saved me