cifs not able to mount by hostname only by ip (solved)
Posted 08-15-2012 at 04:50 AM by ted_chou12
Hi! I recently found when I mount by hostname using cifs, it cannot resolve the hostname, but only IP, like the following:
I did a search and found this post:
http://info300.net/FedoraFirewall/Hosts.php
it inspired me, so I added the following line in /etc/hosts:
And suddenly it worked:
Hope this helps.
Code:
root:# mount -t cifs "//NAS/main" "/mnt/share/NAS" mount error: could not resolve address for NAS: Unknown error vector://home/ted root:# mount -t cifs "//192.168.1.101/main" "/mnt/share/NAS" Password for vl70@//192.168.1.101/main:
http://info300.net/FedoraFirewall/Hosts.php
it inspired me, so I added the following line in /etc/hosts:
Code:
192.168.1.101 NAS
Code:
vector://home/ted root:# umount "/mnt/share/NAS" vector://home/ted root:# mount -t cifs "//NAS/main" "/mnt/share/NAS" Password for vl70@//NAS/main: vector://home/ted
Total Comments 3
Comments
-
/etc/rc.d/rc4.d
Start scripts for gui
Kill scripts for gui
/etc/rc.d/rc2.d
Start scripts for tui
Kill scripts for tui
vector linux osPosted 08-15-2012 at 05:03 AM by ted_chou12 -
From what little has been posted I would suspect that you are not running DNS, can't access your DNS, or do not have NAS defined in a zone. Thus NAS is unresolvable, which is what mount is complaining about. So adding an address and host to your host file takes care of NAS being unresolvable. This is the function of the hosts file and in fact the host file was the way all Internet address were resolved. That takes us back a good 40+ years ago. These days we use DNS instead of the host file. Either way and you find your solution.
Posted 08-16-2012 at 02:40 AM by countrygrrl_ak -
Thanks for the add
Posted 08-16-2012 at 05:17 AM by ted_chou12