Fix the connection problem if all mongodb instances are offline

and the new mongodb instances are advertised only through DNS