Networking Forums  

Go Back   Networking Forums > Networking Newsgroups > Linux Networking

'mount -t cifs' only works with IP addresses, not with hostnames

Reply
 
Thread Tools Display Modes
  #1  
Old 03-05-2007, 02:59 AM
Default 'mount -t cifs' only works with IP addresses, not with hostnames



Facts:

1) There is a Samba server on the local network.

2) Its hostname is 'myserver' and its IP address is 192.168.42.1.

3) The hostname can be resolved via DNS from another computer,
as illustrated below:

--- 8< ---

anothercomputer:~ > ping -c 1 myserver
PING myserver (192.168.42.1): 56 data bytes
64 bytes from 192.168.42.1: icmp_seq=0 ttl=128 time=0.4 ms

--- myserver ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.4/0.4/0.4 ms

--- 8< ---

However, this does not work:

--- 8< ---

anothercomputer:~ > mount -t cifs -o username=foo,password=xyzzy \
//myserver/sharename /mnt/foobar

mount: Mounting //myserver/sharename on /mnt/foobar failed: \
Invalid argument

--- 8< ---

Then again, this _does_ work:

--- 8< ---

anothercomputer:~ > mount -t cifs -o username=foo,password=xyzzy \
//192.168.42.1/sharename /mnt/foobar

anothercomputer:~ >

--- 8< ---

What gives? Any ideas?

By googling around a bit it seems there are numerous questions about the
same problem on the net - on various mailing lists, forums, and
newsgroups - but no answers.

* * *

Note 1: This is _not_ a WINS problem. I'm not trying to use NETBIOS
names! I have no need for NETBIOS name resolution.

Note 2: This is not a generic DNS problem, either. As you can see from
the 'ping' sample output above, resolving 'myserver' to an IP address
works just fine.

Note 3: Explicitly adding 'myserver' to the local '/etc/hosts' file does
not help, either. I have tried that already.

--
znark



Jukka Aho
Reply With Quote
  #2  
Old 03-05-2007, 07:04 PM
buck
Guest
 
Posts: n/a
Default Re: 'mount -t cifs' only works with IP addresses, not with hostnames

On Mon, 5 Mar 2007 04:59:17 +0200, "Jukka Aho" <(E-Mail Removed)>
wrote:


>What gives? Any ideas?


The documentation I have quite clearly says that only IP addresses
work,

Perhaps the reason your search fails to find the answer is that the
question pisses off those who read the question and know the answer.

http://samba.org/cifs
--
buck

Reply With Quote
  #3  
Old 03-08-2007, 01:38 AM
Jukka Aho
Guest
 
Posts: n/a
Default Re: 'mount -t cifs' only works with IP addresses, not with hostnames

buck wrote:

>> What gives? Any ideas?


> The documentation I have quite clearly says that only IP addresses
> work,


Resolving hostnames (or FQDNs) to ip addresses via DNS (or /etc/hosts)
is usually a given, so it didn't occur to me to look for the answer
specifically from the cifs.txt provided with the kernel. I thought it
was a higher-level problem - something to do with /etc/nsswitch,
perhaps.

> Perhaps the reason your search fails to find the answer is that the
> question pisses off those who read the question and know the answer.


Or since your answer given above is not exactly correct either, perhaps
not too many know the correct answer, in which case it is good to repeat
it here for future Google Groups searches, etc.:

CIFS needs a special helper app - mount.cifs, which you install to
/sbin - to resolve DNS names during mount time.

--
znark

Reply With Quote
Reply

Tags
addresses, cifs, hostnames, mount, works

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 11:44 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.