Techyou labs
真正的爱应该超越生命的长度,心灵的宽度,灵魂的深度
常用标签

Dnsyo是一个命令行DNS检测工具,能够在多达1500个不同网络的开放DNS服务器上进行查询。在做了DNS变更的时候用来检查DNS生效或排查DNS设置的时候是非常有用的。

项目地址:https://github.com/samarudge/dnsyo

安装:


pip install dnsyo --upgrade

用法:


$ dnsyo --help                    
usage: dnsyo [options] domain [type]

Query lots of DNS servers and colate the results

positional arguments:
  domain                Domain to query
  type                  Record type (A, CNAME, MX, etc.)

optional arguments:
  -h, --help            show this help message and exit
  --resolverlist RESOLVERLIST
                        Location of the yaml resolvers list to download
                        (http/https)
  --resolverfile RESOLVERFILE
                        Location of the local yaml resolvers file
  --verbose, -v         Extended debug info
  --simple, -s          Simple output mode (good for UNIX parsing)
  --extended, -x        Extended output mode including server addresses
  --threads THREADS, -t THREADS
                        Number of worker threads to use
  --servers SERVERS, -q SERVERS
                        Maximum number of servers to query (or ALL)
  --country COUNTRY, -c COUNTRY
                        Query servers by two letter country code
  --update              Check the list for working servers
  --updateSummary UPDATESUMMARY
                        Location for the summary status of the update
  --updateDestination UPDATEDESTINATION
                        Destination resolver list for update

Dnsyo使用实例

用100个线程同时查询所有DNS服务器上的结果。


$ dnsyo -t 100 -q ALL hi-linux.com

Status: Queried 1097 of 1097 servers, duration: 0:00:42.016678

 - RESULTS

I asked 1097 servers for A records related to hi-linux.com,
324 responded with records and 773 gave errors
Here are the results;


22 servers responded with;
199.27.79.133

39 servers responded with;
103.245.222.133

24 servers responded with;
23.235.47.133

18 servers responded with;
23.235.40.133

69 servers responded with;
185.31.17.133

14 servers responded with;
23.235.46.133

14 servers responded with;
185.31.19.133

14 servers responded with;
199.27.76.133

39 servers responded with;
23.235.43.133

17 servers responded with;
23.235.44.133

26 servers responded with;
185.31.18.133

15 servers responded with;
23.91.98.188

11 servers responded with;
23.235.39.133

2 servers responded with;
141.211.28.87

And here are the errors;


42 servers responded with;
No Nameservers

22 servers responded with;
No Answer

709 servers responded with;
Server Timeout

使用--simple选项采用简单的输出模式,对于UNIX脚本是非常有用的。


$ dnsyo --simple hi-linux.com

INFO QUERIED 500
INFO SUCCESS 222
INFO ERROR 278
RESULT 10 23.91.98.188
RESULT 30 103.245.222.133
RESULT 16 199.27.79.133
RESULT 11 23.235.47.133
RESULT 11 23.235.40.133
RESULT 16 23.235.44.133
RESULT 18 185.31.19.133
RESULT 24 23.235.43.133
RESULT 53 185.31.17.133
RESULT 13 185.31.18.133
RESULT 8 199.27.76.133
RESULT 4 23.235.46.133
RESULT 7 23.235.39.133
RESULT 1 141.211.28.87
ERROR 17 No Answer
ERROR 18 No Nameservers
ERROR 243 Server Timeout

通过指定记录类型查询特定类型的DNS记录,如查询MX记录。


$ dnsyo google.com MX


Status: Queried 500 of 500 servers, duration: 0:00:06.193986

 - RESULTS

I asked 500 servers for MX records related to google.com,
14 responded with records and 486 gave errors
Here are the results;


14 servers responded with;
10 aspmx.l.google.com.
20 alt1.aspmx.l.google.com.
30 alt2.aspmx.l.google.com.
40 alt3.aspmx.l.google.com.
50 alt4.aspmx.l.google.com.



And here are the errors;


473 servers responded with;
No Answer

4 servers responded with;
No Nameservers

9 servers responded with;
Server Timeout

参考:
https://github.com/samarudge/dnsyo
http://xmodulo.com/check-dns-propagation-linux.html

暂无评论

添加新评论