Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

OS: Ubuntu 10.04 Samba & Miredo are installed

share|improve this question
add comment

4 Answers

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.

Edit

An excerpt from my smb.conf which is located at /etc/samba/smb.conf.

Note wins in the last section.

share|improve this answer
1  
I added wins but that didn't change anything. However, I noticed that if I add ".local" after some names it works (with or without the wins setting)... Do you know what's going on there? –  David Feb 24 '11 at 5:38
    
plus in addition to nejode's answer (thanks nejode) I would also check your smb.conf I have added mine to my answer for comparison. –  Allan Feb 24 '11 at 13:27
    
what you need to verify in the smb.conf is that your workgroup is the same as the one in the windows station –  Dror Cohen Apr 27 '12 at 17:35
add comment

Follow the instructions Allan posted, but you need to install the "winbind" (Samba nameservice integration server) package too so you can get name resolution.

share|improve this answer
add comment

Running apt-get install winbind fixed it for me.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.