Cache DNS hostname to adapt to DynDNS services when reconnecting

see jnwatts/microdc2#5

Cache the hostname when connecting for the first time and make a new lookup on a reconnect. This will help to adapt to dynamically changing DNS entries.