A tool used to collect IPv6 usage statistics for zones registered in a given TLD.
Running tldv6stat
with no flags means it will use
zonedata.iis.se to download the
.se
zone into RAM and then start iterating over delegated zones with the default
number of workers while ratelimiting outgoing DNS requests with (very)
conservative defaults.
The DNS request ratelimit is controlled using the -ratelimit
and
-burstlimit
flags. You probably want to increase this (or set -ratelimit 0
to disable ratelimiting entirely) if your resolver can handle it. If
increasing the ratelimit you probably want to set a custom resolver other than
the default of 8.8.8.8:53
as well. The number of workers probably should be
increased as well if operating on large zones.
The tool will output JSON both for the collected statistics as well as any operational logging.
Only statistics are written to stdout
while any logging is written to
stderr
. This is to easily separate them into different files.
The tool allows you to operate on a local zone file rather than downloading it into RAM on each run. To save on startup time (or just be able to operate on the same instance of the zone multiple times) you can do something like this:
$ dig @zonedata.iis.se se AXFR > se.zone
$ tldv6stat -file se.zone
$ tldv6stat -help
Usage of tldv6stat:
-axfr-server string
server to transfer zone from (default "zonedata.iis.se:53")
-burstlimit int
DNS request burst limit, must be at least 1 (default 1)
-dial-timeout string
DNS client dial timeout, 0 means using the miekg/dns default (default "10s")
-file string
zone file to parse
-mx-suffixes string
Comma-separated list of MX suffixes to count matches for, e.g. '.mx.example.com,.mail.example.net'
-ratelimit float
DNS requests allowed per second, 0 means no limit (default 10)
-read-timeout string
DNS client read timeout, 0 means using the miekg/dns default (default "10s")
-resolver string
resolver to query (default "8.8.8.8:53")
-verbose
enable verbose logging
-workers int
number of workers to start (default 10)
-write-timeout string
DNS client write timeout, 0 means using the miekg/dns default (default "0s")
-zone string
zone to investigate (default "se")
-zone-limit int
number of delegated zones to check, -1 means no limit (default -1)
When working on this code the following tools are expected to be used before committing:
go fmt
go vet
staticcheck ./...
(see staticcheck)gosec ./...
(see gosec)golangci-lint run
(see golangci-lint)go test -race