Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I can successfully access one of our local samba shares, which is on a windows pc (called marina) as follows:

$ sudo /usr/bin/smbclient \\\\marina\\resource_library <my password>
Domain=[MARINA] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
smb: \> 

So, that works. I'm now trying to mount the above location (the resource_library folder on marina) to /mnt/resource_library (as a read only folder), but it keeps failing - i've tried a few variations of specifying the location:

$ sudo smbmount \\\\marina\\resource_library /mnt/resource_library -o username=max,password=<my password>,r
mount error: could not resolve address for marina: No address associated with hostname
No ip address specified and hostname not found

and

$ sudo smbmount //marina/resource_library /mnt/resource_library -o username=max,password=<my password>,r
mount error: could not resolve address for marina: No address associated with hostname
No ip address specified and hostname not found

and both of the above with MARINA instead of marina. It's bound to be some dumb mistake i'm making, can anyone see it?

cheers, max

share|improve this question

migrated from stackoverflow.com Aug 11 '10 at 6:36

This question came from our site for professional and enthusiast programmers.

    
Your sudos are un-required for smbclient. You don't need to have root privileges in order to run smbclient. (It may be different with smbmount...) –  Kurt Pfeifle Aug 11 '10 at 12:16
    
Also, with smbclient you can use //servername/sharename (single forward- instead of double backslashes) to address the resources... –  Kurt Pfeifle Aug 11 '10 at 12:18
    
Comment by @the dsc: It seems that no one knows how to really fix this issue in any other way than using this explicit/static IP workarounds. :-/ –  Ivo Flipse Jan 5 '11 at 23:56

4 Answers 4

I've found a non-workaround solution that worked for me, on debian (found it originally in some ubuntu forum, but this config file exists even in fedora, so I guess it's probably universal). I had to add "wins" on the /etc/nsswitch.conf file (and have "wins" installed). The line is now as follows:

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

share|improve this answer

Actually i found an answer, i'm not sure if it will work for everyone though. I'll put it up here in case anyone browses to the page. Basically i just needed to provide the ip address with the smbmount command, which i got with

$ nmblookup marina
querying marina on 192.168.0.255
192.168.0.15 marina<00>

Now, as it happens my life is easier here as 192.168.0.15 has been assigned to the associated mac address as a fixed network ip, so it will never change. So now i can just do

$sudo smbmount //marina/resource_library /mnt/resource_library -o ip=192.168.0.15,username=max,password=<my password>,r 

and it's sorted. If i was dealing with a randomly assigned ip for this smb share then i'm not sure what i'd do but it's not an issue here fortunately. :/

share|improve this answer
    
Thank you for sharing that, but both this answer and the original question are off-topic here. –  nb2580 Aug 10 '10 at 11:09
    
This question is perfectly on-topic on superuser.com –  Kurt Pfeifle Aug 11 '10 at 12:21

Try the command nmblookup marina. It queries the NetBIOS namespace (not DNS) and should return marina's IP address.

If it works, and you are sure that the IP address is static, you can use this address in your smbmount.

If it works, and you have DHCP addresses changing from time to time, try this command:

nmblookup marina \
   | grep -vi querying \
   | grep marina \
   | awk '{print $1}' \
   | uniq

It should return the IP address. If it works, you can change your command

You could do

sudo smbmount //marina/resource_library \
   /mnt/resource_library \
   -o ip=$(nmblookup marina \
        | grep -vi querying \
        | grep marina \
        | awk '{print $1}' \
        | uniq),username=max,password=foobar,r

Of course, this is a long command to remember. But then, you could define an 'alias' named mntmarina in your .bashrc, and you only have to type mntmarina...

share|improve this answer

Substituting my IP address for hostname worked for me. My share is called 'schnack'.

sudo smbmount //192.168.0.103/schnack ~/pipmnt
share|improve this answer

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.