Move name resolving before get server

Since the logic does not need the server instance.

Change-Id: Ib1815c988c4dcace6266c7615c347cda30a55ec4
Merge "Move name resolving before get server"