问题标签 [dnspython]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
4960 浏览

python-2.7 - 尽管有查询答案,dnspython 仍会引发 NoAnswer

当我使用 dnspython 查询权威名称服务器以获取 NS 记录时,它会引发 NoAnswer 异常,尽管我的数据包捕获显示已收到正确的响应。

示例:向 j.gtld-servers.net (192.48.79.30) 询问 stackoverflow.com 的 NS 记录

Wireshark 表明,事实上,答案确实回来了:

查询dig @192.48.79.30 stackoverflow.com ns成功并提供与上面数据包捕获中显示的相同的答案。

有趣的是,host -t NS stackoverflow.com 192.48.79.30响应“stackoverflow.com 没有 NS 记录”失败,在这种情况下,数据包捕获再次显示正在接收响应。

为什么 dnspython 不能正确处理对此查询的响应?

0 投票
1 回答
1162 浏览

python - Is it possible to use dnspython through proxy?

I'm writing a program which gathers basic CNAME information for given domains.
I'm currently using Google's DNS server as the one I'm questioning, but afraid that if I'll send couple of millions DNS lookups this will get me blocked (Don't worry, it's by no means any type of DDOS or anything in that area).

I'm wondering 2 things.
1. is it possible to use dnspython package to send requests through proxy servers? this way I can distribute my requests through several proxies.

2. I couldn't find a reference for a similar thing, but is it possible that I'll get blocked for so many DNS lookups?

Thanks,
Meny

0 投票
0 回答
1340 浏览

python - DNS-Python 特定名称服务器

我想弄清楚,我怎么能做 dig 命令

在dnspython..

我已经尝试过的是:

感谢您的帮助!

0 投票
0 回答
677 浏览

python - 如何使用 dnspython 查询主机模式

假设我想计算匹配一个简单模式的主机数量。例如:

host1.example.com host2.example.com ... host42.example.com

我事先不知道其中有 42 个。我想做的是:

然后能够获得计数的答案长度或迭代实际主机名的答案。

谢谢,

格伦

0 投票
1 回答
921 浏览

python - python 2.7.6 中的 dnspython 1.11.1 EmptyLabel 异常

我刚刚使用“pip install dnspython”安装了 dnspython。然后我打开了一个 python shell 并尝试了以下代码:

并立即得到以下信息:

我在 OSX Mavericks 上使用 python 2.7.6、pip 版本 1.5.4 和 dnspython 版本 1.11.1

0 投票
1 回答
1840 浏览

python - 读取带有 dnspython SOA 错误的区域文件

我真的在努力让 dnspython 读取区域文件,我总是被 SOA 卡住,我尝试过不同区域文件和 python 脚本的组合。

区域文件(来自http://agiletesting.blogspot.com/2005/08/managing-dns-zone-files-with-dnspython.html):

脚本 1(来自http://agiletesting.blogspot.com/2005/08/managing-dns-zone-files-with-dnspython.html):

错误:

python read_zonefile.py example.com.hosts

命令行参数:example.com.hosts

域-example.com

区域来源:example.com。

** 开始节点 **

节点名称:@

--- 开始 RDATASET ---

rdataset 字符串表示:36000 IN SOA ns1 hostmaster 2005081201 28800 1800 2592000 86400

rdataset rdclass:1

rdataset rdtype: 6

rdataset ttl:36000

rdataset 具有以下 rdata:

-- 开始 RDATA --

rdata 字符串表示:ns1 hostmaster 2005081201 28800 1800 2592000 86400

回溯(最近一次通话最后):

文件“read_zonefile.py”,第 31 行,在

NameError:名称“SOA”未定义

脚本 2:

错误:

python create_rev_dns.py example.com.hosts

回溯(最近一次通话最后):

文件“create_rev_dns.py”,第 7 行,在

文件“/usr/lib64/python2.6/site-packages/dns/zone.py”,第 977 行,在 from_file

文件“/usr/lib64/python2.6/site-packages/dns/zone.py”,第 924 行,在 from_text

文件“/usr/lib64/python2.6/site-packages/dns/zone.py”,第 882 行,已读取

文件“/usr/lib64/python2.6/site-packages/dns/zone.py”,第 521 行,在 check_origin

dns.zone.NoSOA

至于区域文件,我从 Godaddy.com 下载了一个区域文件,同样的问题。我从 PRODUCTION Bind 服务器(辅助区域)获取了一个区域文件,同样的错误。

所以我真的很难过,任何帮助都会得到很大的拨款。

0 投票
3 回答
13865 浏览

python - ImportError:没有名为 dns.exception 的模块

我试图在我的代码中使用dnspython,但是当它到达 import 语句时,我收到以下错误:

我曾尝试使用 pip、easy_install 并从 git repo 手动安装,但似乎没有任何效果。有任何想法吗??

代码:

0 投票
1 回答
6631 浏览

python - 使用 dnspython 查询反向 dns 查找

我正在尝试在 dnspython 中查询反向查找。不幸的是,from_address() 函数不允许我通过变量交出 IP。任何想法为什么?

我是 python 新手;如果有人可以帮忙,那就太好了!

0 投票
1 回答
2265 浏览

python - 使用 asyncio 和 dnspython 异步发送 DNS 查询

假设我想使用 dnspython 为 Alexa 排名前 1M 的站点发送各种类型的 DNS 查询(A、AAAA、NS、SOA、DNSKEY、NSEC3、DS 等)。

一个一个地做这件事需要一点时间,因为我要为每个站点发送多个查询。所以我希望在 python 3 中使用 asyncio 执行一些并行性。

我经历了大卫的生成器/协程三部曲,http: //www.dabeaz.com/talks.html ,但我仍然不确定如何完成我的简单任务......

进一步来说,

是一个阻塞函数调用,等待DNS回复回来。

如何在此等待时间内发送其他查询而不使用线程?由于 DNS 查询通常是 udp 数据包,我认为 asyncio 可能会有所帮助。

pycares 似乎不支持我需要的所有记录类型,因此 pycares 和 aiodns 不适用于我的情况。

任何参考和想法都会有所帮助。

0 投票
3 回答
9297 浏览

installation - 在 linux ubuntu 上安装 dnspython

我已经安装了 Ubuntu。我正在尝试使用 zxlolbot。但是当我打开zxlolbot.py它给我一个错误。

我试图安装 dnspython 但我无法安装它。我不使用腻子。