问题标签 [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 回答
474 浏览

python - 如何使用 dnspython 在区域文件中添加别名目标?

我正在使用 boto3 和 dnspython 库为 route-53 托管区域生成区域文件。我能够使用dnspython library(1.14.0)成功生成 A/CNAME/MX/TXT 记录集。但是,由于它没有任何 ALIAS TARGET (A Record) 的实现。我收到此错误:

这是因为 ALIAS 就像不支持 IPV4 的“alias.testdomain.com”。我可以通过编辑python库来生成它。还有其他方法吗?

提前致谢

0 投票
1 回答
2298 浏览

python - 使用不同的名称服务器查询

我将更改域的默认名称服务器,然后获取其 A 记录!我尝试使用以下代码,但问题是当我使用 IP 地址作为名称服务器时,一切正常,但是当我使用名称服务器名称(例如“ns1.google.com”)时,我无法运行代码并出现异常。有什么想法吗?(我使用了这里的代码:Set specific DNS server using dns.resolver (pythondns)

我已经厌倦了以下内容:

这就是我得到的:

0 投票
1 回答
340 浏览

python - Do all DNS root servers and top-level-domain servers (TLD) support DNSSEC?

I know that DNSSEC has been widely implemented since 2010. For Authority name servers, it depends on the admin whether he wants to support DNSSEC or not. However, I would like to know whether or not all root name servers, and all TLD servers support DNSSEC?

How can I use tool like dnspython or dig to check DNSSEC support at root name servers, and TLD servers, or I do not need to check because all of them support DNSSEC already?

0 投票
0 回答
569 浏览

dns - 如何使用 dnspython 验证 IP 地址是 DNSSEC 的?

我将递归 DNS 查询发送到根名称服务器、TLD 服务器和stanford.edu.

根响应:

在此处输入图像描述

顶级域名回应:

在此处输入图像描述

当局回应:

在此处输入图像描述

在所有 3 个级别上,我都可以看到支持 DNSSEC。我如何使用 dnspython 和响应消息中的信息来验证响应消息是否安全且合法?

0 投票
1 回答
1144 浏览

python - dnspython动态更新PeerBadKey

我正在使用 dnspython 尝试对 BIND9 服务器执行更新,但是我不断收到错误的密钥响应(“tsig verify failure (BADKEY)”)——当我使用 nsupdate 时,密钥工作得很好。有没有人成功实现了 dnspython 来针对 BIND DNS 执行动态更新?

这是一个包含所有代码和错误的 GIST: https ://gist.github.com/anonymous/0afc800ef0615aa7c1219ec25c032eef

0 投票
0 回答
76 浏览

python - DNS.RESOLVER.QUERY 在同一个 python 脚本的 exe 文件中给出了意外的输出

我在 Windows 10 上使用 python 2.7。这是我的代码片段:-

我正在查询 dns 服务器以获取 SRV 记录。我将 rdata 作为 RRset 值。我的目标是获取 hostName 并在我的代码中进一步使用它。当我在 IDE 上运行我的 python 程序时,我将 hostName 作为一个字符串,但特别是当我使用 py2exe 将相同的 python 文件转换为 exe 文件时,情况并非如此。我将 dns.resolver.query 的输出作为 HEX in exe文件。我的最终目标是让这个脚本作为 exe 文件运行。

0 投票
1 回答
860 浏览

python - Python:检查域列表的 MX 记录继续运行,然后停止,除非我按 Ctrl+C?

我有一个需要检查有效 MX 记录的域的 Excel 电子表格。它运行前 10 行,然后暂停,然后再次运行接下来的 10 行,然后暂停,然后运行接下来的 41 行,然后暂停,所以对我来说没有真正有意义的模式。

我是否需要告诉它“嘿,如果您在 x 秒内没有找到 mx 记录,请继续前进”,还是有更好的方法完全运行此代码?

0 投票
1 回答
1438 浏览

python-2.7 - 使用 dnspython 添加 PTR 记录

我尝试使用以下代码将带有 dnspython 的 PTR 记录添加到 bind9:

通过时我能够成功添加记录:

但是当通过 nslookup 查询 dns 服务器时,我得到:

问题是“ZYXin-addr.arpa”。部分添加到查询中。在区域文件中,记录的语法正确

有没有更好的方法来使用 dnspython 添加 PTR 记录?

0 投票
2 回答
5744 浏览

python - 为什么 dnspython 给我这个错误?

这是我的简单代码:

我正在host退出一个文件。当我运行它时,我得到以下信息:

奇怪的是,当我在 python repl 中运行测试时,它似乎按预期工作:

此外,我的命令行中的 dns 解析工作得很好:

任何见解表示赞赏。

0 投票
1 回答
1275 浏览

python-2.7 - Query an array of DNS records with dnspython, and proceed to the next element based on a custom timeout

I'm querying a bunch of DNS records with dnspython, it seems to timeout when no reply is received (dns.exception.Timeout: The DNS operation timed out after 30.0006685256958 seconds).

Here's the function:

whereas, if I query the DNS records that exist, an answer is received:
dnsAnswer = dnsResolver.query(domain, 'A')

I'm guessing this is because certain records (such as SRV, AAAA etc.) doesn't exist for github.com. However, they do exist for other domains. Is there a way I can include a timeout (like say, 5 seconds) per query within the for loop?
Something like -
if no response in 5 seconds, move to next element in the array
Or is there a better approach to exclude non-existent records?