[1784] make sure auth uses the synchronous DNS server mode.
also introduce mock DNSService and use it to test the behavior, and to test the resolver behavior doesn't change. the essential part should be quite simple; most of the changes are straightforward interface adjustments. it also includes some editorial cleanups such as adding header-file guards or style guideline fixes.