Networking Forums

Networking Forums > Computer Networking > Linux Networking > 'mount -t cifs' only works with IP addresses, not with hostnames

Reply
Thread Tools Display Modes

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

 
 
Jukka Aho
Guest
Posts: n/a

 
      03-05-2007, 01:59 AM
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

 
Reply With Quote
 
 
 
 
buck
Guest
Posts: n/a

 
      03-05-2007, 06:04 PM
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
 
Jukka Aho
Guest
Posts: n/a

 
      03-08-2007, 12:38 AM
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

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mount using cifs to get ACL info semafuster@googlemail.com Linux Networking 0 03-03-2007 02:17 PM
Mount cifs with a vmware host-only connection? luser32 Linux Networking 1 12-25-2006 04:53 PM
mount.cifs - Can someone give me a working example please? Ohmster Linux Networking 2 10-24-2006 09:56 PM
FC5 - cifs and samba - mount error 12 = Cannot allocate memory Ohmster Linux Networking 0 10-20-2006 04:29 AM
NFS mount won't mount at boot, but mount -a works fine. BT Linux Networking 2 09-23-2004 09:37 PM



1 2 3 4 5 6 7 8 9 10 11