LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Blogs > ted_chou12
User Name
Password

Notices

Rate this Entry

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:
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:
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:
Code:
192.168.1.101	NAS
And suddenly it worked:
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
Hope this helps.
Posted in Uncategorized
Views 6065 Comments 3
« Prev     Main     Next »
Total Comments 3

Comments

  1. Old Comment
    /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 os
    Posted 08-15-2012 at 05:03 AM by ted_chou12 ted_chou12 is offline
  2. Old Comment
    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 countrygrrl_ak is offline
  3. Old Comment
    Thanks for the add
    Posted 08-16-2012 at 05:17 AM by ted_chou12 ted_chou12 is offline
 

  



All times are GMT -5. The time now is 04:35 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration