I'm operating a Ubuntu 18.04 server that mounts a CIFS/SMB share. The name of the server is provided in the form of a DNS record. The record points to one of several storage servers, allowing for maintenance and load balancing.
Consider a very basic
//my-storage-server.somedomain.tld/some-path /mnt/storage cifs auto 0 0
What happens, if
- the DNS record changes, but the storage is still available
- the DNS record changes, and the storage is no longer available (i.e. server does not listen on port 445/TCP any longer and existing connections are dropped)
I'm pretty sure that for 1. the mount stays intact, as the server for sure only resolves the server name once, right? But what about 2.? Do the Linux kernel (CIFS VFS) or the userland tools (cifs-utils) try to re-resolve the server name? Is there a way to configure this?
I have no influence on the storage server. Is there any way to harden the connection for it to become more reliable? My initial idea was to setup a local HAProxy that is forced to resolve the DNS entry each time, or at least use a low TTL. But is there an easier way?