Try to fix race condition in dns resolving.

Need to revisit this DNS business more broadly..