Pass in a domain name or a name server.
11447
def reverse_name_server(self, query, limit=None, **kwargs):
        """"""
        return self._results('reverse-name-server', '/v1/{0}/name-server-domains'.format(query),
                            items_path=('primary_domains', ), limit=limit, **kwargs)
1344062
def set_name(self, name):
        """"""
        if not name:
            name = ''
        self._client['config']['name'] = name
        yield from self._server.client_name(self.identifier, name)
1149004
def _resolve_resource_name(self, name):
        """"""
        if name[:4] == 'http':  # already a url
            return name
        name = name.rstrip('/').lstrip('/')
        return '%s%s/%s' % (self.scheme, self.host, name)
177988
def get_host(self, domain_part):
        
        if self.map.host_matching:
            if domain_part is None:
                return self.server_name
            return to_unicode(domain_part, "ascii")
        subdomain = domain_part
        if subdomain is None:
            subdomain = self.subdomain
        else:
            subdomain = to_unicode(subdomain, "ascii")
        return (subdomain + u"." if subdomain else u"") + self.server_name
548151
def get_server(key, server=MAIN_SERVER, servers=LOAD_SERVERS):

    

    namecoind = NamecoindClient(NAMECOIND_SERVER, NAMECOIND_PORT,
                                NAMECOIND_USER, NAMECOIND_PASSWD)

    info = namecoind.name_show(key)

    if 'address' in info:
        return check_address(info['address'], server, servers)

    response = {}
    response["registered"] = False
    response["server"] = None
    response["ismine"] = False
    return response
1351169
def serve(name: str = "", port: int = 5000) -> None:
    
    logging.info(" * Listening on port %s", port)
    httpd = HTTPServer((name, port), RequestHandler)
    httpd.serve_forever()
787922
def add_single(self, hostname, ports, nickname=None, **kws):
        '''
            
        '''
        nickname = nickname or hostname

        self[hostname.lower()] = ServerInfo(nickname, hostname, ports, **kws)
987599
function(host, next) {
    var tokens = tldtools.extract(host),
      resolvingHost;

    if (ipaddr.IPv4.isValid(host) || ipaddr.IPv6.isValid(host) ) {
      next(false, [ host ], host);
    } else {
      resolvingHost = tokens.inspect.getDomain() || tokens.domain;
      dns.resolve(resolvingHost, function(err, aRecords) {
        next(err, aRecords, resolvingHost );
      });
    }
  }
990272
private function get_server($domain='')
    {
        if(Request::isHttps()){
            $prefix='https://';
        }else{
            $prefix='http://';
        }
        $c=Config::get('is_simple_url');
        if($domain==''){
            $domain=get_domain();
        }
        return $prefix.$domain;
    }
452503
def usernameAvailable(self, username, domain):
        
        if len(username) < 2:
            return [False, u"Username too short"]
        for char in u"[ ,:;<>@()!\"'%&\\|\t\b":
            if char in username:
                return [False,
                        u"Username contains invalid character: '%s'" % char]

        # The localpart is acceptable if it can be parsed as the local part
        # of an RFC 2821 address.
        try:
            parseAddress("<%s@example.com>" % (username,))
        except ArgumentError:
            return [False, u"Username fails to parse"]

        # The domain is acceptable if it is one which we actually host.
        if domain not in self.getAvailableDomains():
            return [False, u"Domain not allowed"]

        query = self.store.query(userbase.LoginMethod,
                                 AND(userbase.LoginMethod.localpart == username,
                                     userbase.LoginMethod.domain == domain))
        return [not bool(query.count()), u"Username already taken"]
494998
public ObjectName preRegister(MBeanServer server, ObjectName name)
			throws Exception {
		oname=name;
        mserver=server;
        domain=name.getDomain();
        return name;
	}
1328692
def _get_url(ssl, url, port, path):
    '''
    
    '''
    if ssl:
        return 'https://{0}:{1}/management/domain/{2}'.format(url, port, path)
    else:
        return 'http://{0}:{1}/management/domain/{2}'.format(url, port, path)
555619
def server(name='proxy-server', headers_middleware=None,
           server_software=None, **kwargs):
    ''''''
    if headers_middleware is None:
        headers_middleware = [x_forwarded_for]
    wsgi_proxy = ProxyServerWsgiHandler(headers_middleware)
    kwargs['server_software'] = server_software or SERVER_SOFTWARE
    return wsgi.WSGIServer(wsgi_proxy, name=name, **kwargs)
40722
def _relative_name(self, record_name):
        """"""
        # Handle None and empty strings as None
        if not record_name:
            return None
        subdomain = super(Provider, self)._relative_name(record_name)
        return subdomain if subdomain else None
176609
def get_name(self, origin=None):
        """"""

        token = self.get()
        if not token.is_identifier():
            raise dns.exception.SyntaxError('expecting an identifier')
        return dns.name.from_text(token.value, origin)
572431
def delete_domain(self, domain, params=None):
        ''' 
        '''
        params = update_params(params, {'domain': domain})
        return self.request('/v1/dns/delete_domain', params, 'POST')
476667
def get_domain_name(url):
    
    if not url.startswith("http"):
        url = "http://" + url
    if not is_valid_url(url):
        raise ValueError("Invalid URL '%s'" % url)
    parse = urlparse(url)
    return parse.netloc