Review your favorite Linux distribution.
Go Back > Blogs > ted_chou12
User Name


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:
root:# mount -t cifs "//NAS/main" "/mnt/share/NAS"
mount error: could not resolve address for NAS: Unknown error
root:# mount -t cifs "//" "/mnt/share/NAS"
Password for vl70@//
I did a search and found this post:
it inspired me, so I added the following line in /etc/hosts:
Code:	NAS
And suddenly it worked:

root:# umount "/mnt/share/NAS"
root:# mount -t cifs "//NAS/main" "/mnt/share/NAS"
Password for vl70@//NAS/main: 
Hope this helps.
Posted in Uncategorized
Views 12211 Comments 3
« Prev     Main     Next »
Total Comments 3


  1. Old Comment
    Start scripts for gui
    Kill scripts for gui
    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 05:53 PM.

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