我想在我的网络应用中添加反向DNS查询以检查googlebot用户代理的真实性,正如谷歌在webmasters tools中建议的那样。是否存在异步执行此操作的标准方法?我在龙卷风文档中找不到任何东西。我发现的只有this Github项目,它将反向DNS列为未来功能。有没有办法避免阻止反向DNS查找?
由于
答案 0 :(得分:1)
您可以在socket.gethostbyaddr
中致电ThreadPoolExecutor
或使用pycares
(做tornado.platform.caresresolver' but for
gethostbyaddr instead of
getaddrinfo`中的内容。