【问题标题】:Why reverse DNS resolution is not implemented in Twisted?为什么在 Twisted 中没有实现反向 DNS 解析?
【发布时间】:2016-07-09 01:55:31
【问题描述】:

我在 twisted.names.client 方法中找不到反向 dns 解析。是否可以通过扭曲的方式做到这一点 - 没有阻塞(响应时间)?

是否使用socket.gethostbyaddr() 阻止查询?

【问题讨论】:

  • t.n.client.lookupPointer 不提供 PTR 记录查找吗?
  • 不适合我:` >>> from twisted.names import client >>> client.lookupPointer('8.8.8.8') >>> _ >> >>> import socket >>> socket.gethostbyaddr('66.35.39.66') ('dornkirk .twistedmatrix.com', [], ['66.35.39.66']) >>> >>> socket.gethostbyaddr('8.8.8.8') ('google-public-dns-a.google.com', [] , ['8.8.8.8']) `

标签: python dns twisted


【解决方案1】:

反向 DNS 查找可能应该是 API 的内置部分,但它们很容易实现为简单的字符串转换。事实上,the Twisted documentation uses reverse name lookups as its main way of explaining the client API。看看那个链接的文档,希望它能回答你的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-20
    • 2023-03-19
    相关资源
    最近更新 更多