
If you manage multiple servers, it is easy to lose track of how many websites you actually host. In cPanel and WHM environments, the quickest way to get a reliable count is to check how many DNS zone files exist on your nameserver.
This method works for single servers and for DNS clusters. It is also a great way to verify totals before migrations, billing audits, or capacity planning.
Why count hosted sites
Knowing your exact hosted site count helps you:
- Track growth and report accurate numbers to your team
- Validate hosting limits and plan resource upgrades
- Prepare for server migrations and account moves
- Confirm DNS cluster synchronization and health
- Keep billing and compliance reports consistent
For us we wanted to list the number of sites we host and we executed this.
The quick command for cPanel WHM
On a standard cPanel server, each DNS zone is stored as a .db file inside /var/named. You can count them with this command:
ls -1 /var/named | grep '\.db$' | wc -l
Example output
[root@ns2 ~]# ls -1 /var/named | grep '\.db$' | wc -l
59618
That number represents the total DNS zones on that server. In most cases, that is the same as the number of active domains you host.
If you use a DNS cluster
If your setup uses a DNS cluster, run this command on a cPanel DNSonly server. The DNSonly node holds the authoritative list of all zones across the cluster. This gives you the best overall count of hosted domains.
If you run the command on a single web server inside the cluster, you will only see the zones that live on that server.
What the result actually means
The count reflects DNS zones, not cPanel accounts. A single cPanel account can contain multiple domains, and some parked domains can share a zone. This is normal. For a quick and simple inventory, the DNS zone count is still the best starting point.
Final notes
This quick check is fast, safe, and works even on large clusters. If you are preparing a report, planning capacity, or verifying a DNS sync, this is the most direct way to get an accurate number.
If you need help auditing your hosting environment or optimizing your DNS setup, our team can assist.


