0

I have a cifs share working correctly in fstab using

//192.168.x.x/directory/to/folder /media/my/directory cifs ...

However since our company network dynamically allocates ip addresses, is there a way to mount a cifs folder using something like:

//mypc.servername.local/directory/to/folder /media/my/directory cifs ...

So that even if the computer's IP address gets changed, the pi can still access the drive?

  • Simple answer: Yes. – Huczu Jun 23 '16 at 10:06
  • @Huczu Excellent, can you send me a link or write something to elaborate how? – Pingk Jun 23 '16 at 10:18
  • But you got it. Use hostname/servername instead of ip address, but network should be configured. More information at: unix.stackexchange.com/questions/16890/… – Huczu Jun 23 '16 at 10:31
  • @Huczu Turns out the samba config file wasn't correct (see my answer) – Pingk Jun 23 '16 at 11:47
0

The cleanest way is to setup or reconfigure the existing DNS server on your company network. You need to instruct your company DHCP server to point to aforementioned DNS server.

A competent Windows admin will know how to do this easily with Windows Server.

Most cheap SOHO routers should have an easy way to to do this via web-interface too. Some even manage the "fake" .local TLD by default ! Sadly ISPs often hide router manuals or rebrand COTS routers in a confusing way. If you get stuck persitence in the search for manuals will be needed.

Alternatively , dnsmasq is both a DHCP and DNS server for Linux and makes this very easy. You can even run it on a Raspberry Pi !

http://www.andrewoberstar.com/blog/2012/12/30/raspberry-pi-as-server-dns-and-dhcp

0

It turns out our Windows server doesn't use wins, while the samba.conf file by default has wins enabled.

The settings we changed were as follows:

[global]
wins support = no
# wins server = w.x.y.z
dns proxy = yes

Then remounting using //mypc.servername.local/... in fstab worked correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.