List of domains on DNS server?
Rather than use grep
on all of the zone files, use:
% rndc dumpdb -zones
This will create a dump of the server's authoritative data called named_dump.db
, probably in /var/named/data
(or similar).
This file is easier to parse than the original zone files because every line starts with the domain name to which it applies. The raw zone files are probably abbreviated.