'Scan our hosted zones for the record of a given name.
Returns the record entry, else None.'

def get_domain_name(self, domain_name):

    try:
        self.apigateway_client.get_domain_name(domainName=domain_name)
    except Exception:
        return None
    try:
        zones = self.route53.list_hosted_zones()
        for zone in zones['HostedZones']:
            records = self.route53.list_resource_record_sets(HostedZoneId=zone['Id'])
            for record in records['ResourceRecordSets']:
                if ((record['Type'] in ('CNAME', 'A')) and (record['Name'][:(-1)] == domain_name)):
                    return record
    except Exception as e:
        return None
    return None
