common: limit potentially expensive name lookups
Right now we're doing name look ups when we don't have to. These
name look ups can cause lengthy timeouts in misconfigured environments.
This commit reduces the name looks used by GDM to make it more resiliant
to failure.