通过WHM或SSH了解有多少DNS查询/月?

Modified on: Fri, 20 Sep 2019 01:40:02 +0800

有可能吗?我们完全控制了我们的DNS服务器和实际指向的服务器。我们感兴趣的是我们目前有多少DNS查询,因为我们想要迁移到Ultra DNS,但我们需要知道一个月内我们可能会收到多少查询。

这有可能搞清楚吗?在跟踪开始之前我是否需要启动服务?或者使用shell来访问数据?

最佳答案

正如AndyN所说,答案是:

sudo rndc stats

当你运行它时(如果在named.conf文件中配置),Bind会将统计信息转储到配置的统计文件中。

您需要检查以下行的/etc/bind/named.conf.*文件:

 [ statistics-file "path_name"; ]

(在Ubuntu上它是named.conf.options,路径是/var/run/named/named.stats

从您的问题看来,您需要知道大约数量的DNS查询以进行扩展。您应该能够从文件中大致了解这一点。

运行
    sudo rndc stats

然后经过适当的时间(几个小时?几天?)再次运行。

在您的统计文件中,您将看到以下内容(这来自我自己的家庭DNS服务器 - 它既是缓存解析器又是权威的。)

为大量信息道歉...第一行中的数字是“大纪元时间”(自1970-1-1 00:00 UTC以来的秒数)。使用此功能,您可以计算出从一个“rndc stats”到下一个“rndc stats”的时间差异以及不同数量的请求(您将要查看Incoming“QUERY”和Outgoing totals(A + NS + SOA + PTR) + TXT + AAAA)。

+++ Statistics Dump +++ (1275999954)
++ Incoming Requests ++
                432 QUERY
++ Incoming Queries ++
                 306 A
                   2 NS
                   4 SOA
                  45 PTR
                   5 TXT
                  70 AAAA
++ Outgoing Queries ++
[View: default]
                 523 A
                   4 NS
                   4 SOA
                  42 PTR
                   9 TXT
                 330 AAAA
[View: _bind]
++ Name Server Statistics ++
                 432 IPv4 requests received
                 431 responses sent
                 259 queries resulted in successful answer
                  96 queries resulted in authoritative answer
                 335 queries resulted in non authoritative answer
                  39 queries resulted in nxrrset
                 133 queries resulted in NXDOMAIN
                 238 queries caused recursion
                   1 duplicate queries received
++ Zone Maintenance Statistics ++
++ Resolver Statistics ++
[Common]
[View: default]
                 849 IPv4 queries sent
                  63 IPv6 queries sent
                 841 IPv4 responses received
                  67 NXDOMAIN received
                   2 FORMERR received
                   2 EDNS(0) query failures
                 123 query retries
                   5 query timeouts
                 118 IPv4 NS address fetches
                 118 IPv6 NS address fetches
                   1 IPv4 NS address fetch failed
                  90 IPv6 NS address fetch failed
                  13 queries with RTT < 10ms
                 549 queries with RTT 10-100ms
                 279 queries with RTT 100-500ms
[View: _bind]
++ Cache DB RRsets ++
[View: default]
                 366 A
                  87 NS
                   9 CNAME
                   1 PTR
                  97 AAAA
                  20 RRSIG
                  15 NSEC
                   4 !AAAA
                   1 NXDOMAIN
[View: _bind]
++ Socket I/O Statistics ++
                 852 UDP/IPv4 sockets opened
                  64 UDP/IPv6 sockets opened
                   3 TCP/IPv4 sockets opened
                   2 TCP/IPv6 sockets opened
                 850 UDP/IPv4 sockets closed
                  63 UDP/IPv6 sockets closed
                 123 TCP/IPv4 sockets closed
                   1 UDP/IPv4 socket bind failures
                  63 UDP/IPv6 socket connect failures
                 849 UDP/IPv4 connections established
                 124 TCP/IPv4 connections accepted
                  63 UDP/IPv6 send errors
                   3 UDP/IPv4 recv errors
++ Per Zone Query Statistics ++
--- Statistics Dump --- (1275999954)
作者:wawawawa

相关问答

添加新评论