标签: rdap

如何成功使用RDAP协议而不是whois

我对新的 RDAP 协议以及何时进一步追求它感到有些困惑。在我看来,每个人都同意它成为 whois 的继任者,但他们的数据库似乎是空的。在 ubuntu 上,我尝试了 rdapper、nicinfo 甚至他们的 RESTful API:

http://rdap.org/domain/google.com (这会导致“找不到文件”,但根据此处是正确的)

我误解了什么吗?RDAP 死了,服务还没有启动还是我做错了什么?Nicinfo 返回这个:

nicinfo -t domain google.com
# NicInfo v.1.1.0-alpha
# Query yielded no results.

[ NOTICE ] Terms of Service
         1 By using the ARIN RDAP/Whois service, you are agreeing to the RDAP/Whois
           Terms of Use
     About https://www.arin.net/whois_tou.html

 [ ERROR ] DOMAIN NOT FOUND
      Code 404
         1 The domain you are seeking as 'google.com.' is/are not here.
Run Code Online (Sandbox Code Playgroud)

rdapper 返回这个:

rdapper --TYPE domain google.com
Error: …
Run Code Online (Sandbox Code Playgroud)

linux standards client whois rdap

6
推荐指数
1
解决办法
1677
查看次数

处理多个 KeyError 异常的更优雅的方法

我有以下函数,它读取 adict并影响局部变量的一些值,然后将其作为元组返回。

问题是字典中可能不存在某些所需的键。

到目前为止,我已经有了这段代码,它可以实现我想要的功能,但我想知道是否有更优雅的方法来实现它。

def getNetwork(self, search):

    data = self.get('ip',search)
    handle         = data['handle']
    name           = data['name']
    try:
        country        = data['country']     
    except KeyError:
        country = ''
    try:       
        type           = data['type']
    except KeyError:
        type = ''
    try:                
        start_addr     = data['startAddress']
    except KeyError:
        start_addr = ''
    try:                 
        end_addr       = data['endAddress']
    except KeyError:
        end_addr = '' 
    try:                  
        parent_handle  = data['parentHandle']
    except KeyError:
        parent_handle = ''   
    return (handle, name, country, type, start_addr, end_addr, parent_handle)
Run Code Online (Sandbox Code Playgroud)

我有点害怕很多,try: except:但如果我把所有的影响都放在一个单一的里面,try: except:一旦第一个缺失的字典键引发错误,它就会停止影响值。

python json python-3.x rdap

4
推荐指数
1
解决办法
2538
查看次数

Rdap 查询的结果比 google.com 的 whois 少?

当我对 Google.com 进行简单的域名 whois 查找时,我得到以下结果:

[...]
Registrant Organization: Google LLC
Registrant State/Province: CA
Registrant Country: US
Registrant Email: Select Request Email Form at https://domains.markmonitor.com/whois/google.com
Admin Organization: Google LLC
Admin State/Province: CA
Admin Country: US
Admin Email: Select Request Email Form at https://domains.markmonitor.com/whois/google.com
Tech Organization: Google LLC
Tech State/Province: CA
Tech Country: US
[...]
Run Code Online (Sandbox Code Playgroud)

但是当我使用 rdap 时,例如使用以下网站:

https://client.rdap.org/?type=domain&object=google.com
Run Code Online (Sandbox Code Playgroud)

生成的 json 不包含任何指向 Google LLC 的数据。这是因为我以错误的方式使用 rdap 还是因为 Google 的 rdap 条目根本不包含注册人/管理员/技术组织数据?

whois rdap

3
推荐指数
1
解决办法
634
查看次数

标签 统计

rdap ×3

whois ×2

client ×1

json ×1

linux ×1

python ×1

python-3.x ×1

standards ×1