Menü schliessen
Created: April 2nd 2013
Last updated: May 1st 2020
Categories: Linux
Author: Marcus Fleuti

Mount Windows DFS share on Debian Linux (Squeeze) using SMB / CIFS protocol produces dns_resolve_server_name_to_ip error

Tags:  cifs-utils,  Debian,  DFS,  DNS,  keyutils,  Linux,  smbfs,  Squeeze
Donation Section: Background
Monero Badge: QR-Code
Monero Badge: Logo Icon Donate with Monero Badge: Logo Text
82uymVXLkvVbB4c4JpTd1tYm1yj1cKPKR2wqmw3XF8YXKTmY7JrTriP4pVwp2EJYBnCFdXhLq4zfFA6ic7VAWCFX5wfQbCC

Howto mount a Windows DFS share on Debian Linux correctly

In order to being able to mount a DFS share correctly you need to install the following tools on your Debian host:

aptitude install smbfs cifs-utils keyutils

After the installation of the tools you will be able to mount the share using on of these methods:

#1 manual mounting a CIFS/SMB directory:

mount.cifs //myDomain.com/dfs_root/Sharename /mnt/cifs_mountpoint -o username=UserName,password=Passw0rd

#2 mounting with AUTOFS (automatic mounting)

Edit the file /etc/auto.master:

nano /etc/auto.master

Enter a line like this (timeout means: unmount after xx seconds):

/mnt/MyShare /etc/auto.smb   --timeout 600

Edit the file /etc/auto.smb:

nano /etc/auto.smb

Enter the command to mount your directory (in the example we directly connect the DFS share on the domain controller):

MySMBShareName  -fstype=smbfs,rw,soft,username=MyUsername,password=MyPassword ://servername/dfs/folder/subfolder

Save the file and change its permissions (Attention! The file MAY NOT be executable. If it is the AUTOFS daemon won't parse it):

chmod a-x /etc/auto.smb

chmod 600 /etc/auto.smb

Restart the AUTOFS daemon

/etc/init.d/autofs restart

Check if you can access your share:

cd /mnt/MyShare/MySMBShareName

Done.