'Find the domain_id for a given domain.
:param str domain: The domain for which to find the domain_id.
:raises errors.PluginError: if the domain_id cannot be found.'

def _find_domain_id(self, domain):

    domain_name_guesses = dns_common.base_domain_name_guesses(domain)
    for domain_name in domain_name_guesses:
        try:
            self.provider.options['domain'] = domain_name
            self.provider.authenticate()
            return
        except HTTPError as e:
            result = self._handle_http_error(e, domain_name)
            if result:
                raise result
        except Exception as e:
            result = self._handle_general_error(e, domain_name)
            if result:
                raise result
    raise errors.PluginError('Unable    to    determine    zone    identifier    for    {0}    using    zone    names:    {1}'.format(domain, domain_name_guesses))
