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.

I know that similar questions has already been asked. However, as suggested in the answers to that question I have the winbind package installed and have wins in /etc/nsswitch.conf:

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

Nevertheless, attempts to ping windows hostnames give

ping: unknown host <hostname>

Restarting winbind service doesn't help.

I have Ubuntu 11.10 and winbind 3.5.11.

share|improve this question
    
Not clear by your question, but are you trying to access shared folders from windows machine??? –  rao_555 Jan 6 '12 at 14:17
    
@rao_555: no, just ping a windows machine –  vitaut Jan 6 '12 at 14:19
    
if you'r windows machine are in same network, you can directly ping the windows machine, you dont need winbind for that. The main use of winbind is for unified logon. –  rao_555 Jan 6 '12 at 14:25
    
@rao_555: that's what I am doing, but the name is not resolved –  vitaut Jan 6 '12 at 14:59
    
check if your linux machine is in your network. check if you are able to ping the linux machine's ip-address from windows system. Also, check if you are able to ping windows machine ip-address –  rao_555 Jan 6 '12 at 15:12
add comment

2 Answers

I had the same issue. Changing the location of wins in nslookup.conf did not work, or possibly only got me part of the way there. Install the package libnss-winbind to be able to find windows computers by hostname. I tested it with and without the package installed, and it is indeed necessary for resolving any windows hostname.

share|improve this answer
1  
+1 could not resolve windows host names without this library (even if nmblookup works) –  Sandeep Datta Apr 14 at 12:46
add comment

The order of operands in the hosts definition in /etc/nsswitch.conf is important. In your case, host name resolution is terminated by the [NOTFOUND=return] statement before WINS name resolution ever happens. Move 'wins' so it's just after 'files', and you should be good to go:

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

nmblookup (part of the samba-common-bin package) is another useful troubleshooting tool for this situations--it can be used to manually verify that the hostname you're using is valid.

share|improve this answer
    
Placing wins before [NOTFOUND=return] breaks name resolution in chrome and firefox. –  vitaut Jan 23 '12 at 11:25
    
How exactly is name resolution breaking? Do all name lookups fail to resolve, or just NetBIOS names? Also, does ping work with the modified hosts line? –  cqcallaw Jan 23 '12 at 16:17
    
When I place wins before [NOTFOUND=return] the browser is unable to open google.com and other sites, so it's not only NetBIOS. When I change it back, sites open normally. The ping does work with the modified hosts line. –  vitaut Jan 23 '12 at 16:48
    
The 'wins' statement needs to go after 'files', not after 'mdns4_minimal'. If you put 'wins' after 'mdns4_minimal' and before '[NOTFOUND=return]', then you're telling the name resolution routines to return if the NetBIOS name isn't found, which skips dns. Try moving 'wins' so it's immediately after 'files'. If you still have issues, try moving 'dns' so it's before 'mdns_minimal' as well, like so: hosts: files dns wins mdns4_minimal [NOTFOUND=return] mdns4 –  cqcallaw Jan 23 '12 at 16:56
1  
Mr cqcallaw You should at least mention which config files we should change/edit –  user89326 Sep 13 '12 at 10:28
show 1 more 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.