def getResolver():
 global theResolver
 if (theResolver is None):
  try:
   theResolver = createResolver()
  except ValueError:
   theResolver = createResolver(servers=[('127.0.0.1', 53)])
 return theResolver

def getResolver ( ) : global theResolver if ( theResolver is None ) : try : theResolver = createResolver ( ) except ValueError : theResolver = createResolver ( servers = [ ( '127.0.0.1' , 53 ) ] ) return theResolver
get a resolver instance .