Returns a list of all subdomains for the specified domain.
192854
def list_subdomains(self, domain, limit=None, offset=None):
        
        return domain.list_subdomains(limit=limit, offset=offset)
1078291
def get_all_subdomains(offset=0, count=100, proxy=None, hostport=None):
    
    assert proxy or hostport, 'Need proxy or hostport'
    if proxy is None:
        proxy = connect_hostport(hostport)

    offset = int(offset)
    count = int(count)

    page_schema = {
        'type': 'object',
        'properties': {
            'names': {
                'type': 'array',
                'items': {
                    'type': 'string',
                    'uniqueItems': True
                },
            },
        },
        'required': [
            'names',
        ],
    }

    schema = json_response_schema(page_schema)

    try:
        resp = proxy.get_all_subdomains(offset, count)
        resp = json_validate(schema, resp)
        if json_is_error(resp):
            return resp

        for name in resp['names']:
            if not is_subdomain(str(name)):
                raise ValidationError('Not a valid subdomain: {}'.format(str(name)))

    except ValidationError as ve:
        if BLOCKSTACK_DEBUG:
            log.exception(ve)

        resp = {'error': 'Server response did not match expected schema.  You are likely communicating with an out-of-date Blockstack node.', 'http_status': 502}
        return resp

    except socket.timeout:
        log.error("Connection timed out")
        resp = {'error': 'Connection to remote host timed out.', 'http_status': 503}
        return resp

    except socket.error as se:
        log.error("Connection error {}".format(se.errno))
        resp = {'error': 'Connection to remote host failed.', 'http_status': 502}
        return resp

    except Exception as ee:
        if BLOCKSTACK_DEBUG:
            log.exception(ee)

        log.error("Caught exception while connecting to Blockstack node: {}".format(ee))
        resp = {'error': 'Failed to contact Blockstack node.  Try again with `--debug`.', 'http_status': 500}
        return resp

    return resp['names']
1321939
def get_subdomains_count(self, accepted=True, cur=None):
        
        if accepted:
            accepted_filter = 'WHERE accepted=1'
        else:
            accepted_filter = ''

        get_cmd = "SELECT COUNT(DISTINCT fully_qualified_subdomain) as count FROM {} {};".format(
            self.subdomain_table, accepted_filter)

        cursor = cur
        if cursor is None:
            cursor = self.conn.cursor()

        db_query_execute(cursor, get_cmd, ())

        try:
            rowdata = cursor.fetchone()
            return rowdata['count']
        except Exception as e:
            if BLOCKSTACK_DEBUG:
                log.exception(e)
            return 0
958363
def subdomain?(*jids)
      !jids.flatten.index do |jid|
        !component?(jid) && !pubsub?(jid)
      end
    end
1217025
def get_netki_domains(self, fetch=False):
        """"""
        return NetkiDomains(
            self.resource.netki_domains, self.client, populate=fetch)
632725
def domains(self):
        
        if self._domains is None:
            self._domains = DomainList(self._version, account_sid=self._solution['account_sid'], )
        return self._domains
787571
def get_affected_domains(self):
        
        results = set()
        dotted_domain = ("." + self.domain) if self.domain else None
        for website in self.websites:
            for subdomain in website['subdomains']:
                if self.domain is None or subdomain == self.domain or \
                        (self.include_subdomains and subdomain.endswith(dotted_domain)):
                    results.add(subdomain)

        # sort them by lenght so the shortest domain is the first
        results = sorted(list(results), key=lambda item: len(item))
        return results
119216
def list(self, domain_id, sub_domain=None):
        '''
        '''
        optional_args = {}
        if sub_domain != None:
            optional_args['sub_domain'] = sub_domain
        r = self._api.do_post('Record.List', domain_id=domain_id,
                              **optional_args)
        record_list = []
        for record in r['records']:
            record['domain_id'] = domain_id
            record_list.append(Record(record))
        return record_list
139094
public function getDomains()
    {
        $q = $this
            ->createQueryBuilder('m')
            ->select('m.domain')
            ->distinct()
            ->orderBy('m.domain');

        $ret = array();
        foreach ($q->getQuery()->execute() as $result) {
            $ret[$result['domain']] = $result['domain'];
        }
        return $ret;
    }
555332
def domain_sites():
    

    if not hasattr(env,'domains'):
        sites = _get_django_sites()
        site_ids = sites.keys()
        site_ids.sort()
        domains = []
        
        for id in site_ids:

            for file in _sitesettings_files():
                domain = _AttributeDict({})

                if file == 'settings.py':
                    domain.name = sites[id]
                else: #prefix indicates subdomain
                    subdomain = file[:-12].replace('_','.')
                    domain.name = ''.join([subdomain,sites[id]])

                domain.settings = file
                domain.site_id = id
                domains.append(domain)
                
        env.domains = domains
        if env.domains: env.root_domain = env.domains[0].name
        else:
            domain.name = _root_domain(); domain.site_id = 1; domain.settings='settings.py'
            env.domains = [domain]
            
    return env.domains
1116024
def get_domains(self):
        
        url = self.API_TEMPLATE + self.DOMAINS
        data = self._get_json_from_response(url)

        domains = list()
        for item in data:
            domain = item['domain']
            domains.append(domain)
            self.logger.debug('Discovered domains: {}'.format(domain))

        return domains
511290
def list_domains(custom_headers:nil)
      response = list_domains_async(custom_headers:custom_headers).value!
      response.body unless response.nil?
    end
1184632
def subdomain(self, hostname):
        
        hostname = hostname.split(":")[0]
        for domain in getDomainNames(self.siteStore):
            if hostname.endswith("." + domain):
                username = hostname[:-len(domain) - 1]
                if username != "www":
                    return username, domain
        return None
894623
def subdomains(tld_length = 1)
      parts = host.split(Merb::Const::DOT)
      parts[0..-(tld_length+2)]
    end
528251
public java.util.List<String> getDomainNames() {
        if (domainNames == null) {
            domainNames = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return domainNames;
    }
1145302
public function getAllDomains()
    {
        $domains = TransUnitQuery::create()
            ->select('Domain')
            ->setDistinct()
            ->orderByDomain(Criteria::ASC)
            ->find($this->getConnection())
        ;

        return array_values($domains->getArrayCopy());
    }
938398
def lookup_domain(domain, nameservers=[], rtype="A",
                  exclude_nameservers=[], timeout=2):
    """"""
    dns_exp = DNSQuery(domains=[domain], nameservers=nameservers, rtype=rtype,
                       exclude_nameservers=exclude_nameservers, timeout=timeout)
    return dns_exp.lookup_domain(domain)