def DNSServiceEnumerateDomains(flags, interfaceIndex=kDNSServiceInterfaceIndexAny, callBack=None):
 @_DNSServiceDomainEnumReply
 def _callback(sdRef, flags, interfaceIndex, errorCode, replyDomain, context):
  if (callBack is not None):
   callBack(sdRef, flags, interfaceIndex, errorCode, replyDomain.decode())
 _global_lock.acquire()
 try:
  sdRef = _DNSServiceEnumerateDomains(flags, interfaceIndex, _callback, None)
 finally:
  _global_lock.release()
 sdRef._add_callback(_callback)
 return sdRef

def DNSServiceEnumerateDomains ( flags , interfaceIndex = kDNSServiceInterfaceIndexAny , callBack = None ) : @ _DNSServiceDomainEnumReply def _callback ( sdRef , flags , interfaceIndex , errorCode , replyDomain , context ) : if ( callBack is not None ) : callBack ( sdRef , flags , interfaceIndex , errorCode , replyDomain . decode ( ) ) _global_lock . acquire ( ) try : sdRef = _DNSServiceEnumerateDomains ( flags , interfaceIndex , _callback , None ) finally : _global_lock . release ( ) sdRef . _add_callback ( _callback ) return sdRef
asynchronously enumerate domains available for browsing and registration .