Ubuntu – Smbclient finds NAS, but mount can’t find it

14.04fstabmountnetworkingsamba

I'm trying to auto-mount a NAS drive I have to Ubuntu Server, but it's giving me an issue where it doesn't seem to find the NAS name on the network when I mount it.

Pulling up the shares like this works fine, and gives me a print out of the shares on the NAS.

smbclient -L //NASNAMEHERE

I proceeded to add the share I want to /etc/fstab using the line below. The .smbcredentials file contains the user/pass combo for RW access to the share.:

//NASNAMEHERE/Archive    /home/user/Archive        cifs    credentials=/home/user/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

However, when I run sudo mount -a to mount the new device, it gives me this.

mount error: could not resolve address for martinez-nas: Unknown error

It seems to be a networking issue, as I can't seem to ping the NAS by name directly, but I'm confused about why this won't work, if smbclient can properly find the NAS and list the shares.

Running Ubuntu Server 14.04.2

Best Answer

Found this question which answers it for me. Basically, Samba can do hostname lookups, while mount can't. I set the IP address instead of the hostname in /etc/fstab, and it worked like a charm.