This article provides a guide for how to query all domains and return the resolved IPs for cPanel WHM servers.
How to Query All Domains and Return the Resolved IPs for cPanel WHM Servers
To query all domains and return the resolved IPs, follow the steps below:
- Login via SSH as root.
- Run the following command:
awk -F : {'print $1'} /etc/userdatadomains | grep -v nobody | while read x; do echo "checking $x"; echo "$x resolves to $(dig +short $x)"; echo; done > resolvedips.txt - The output will be displayed in the console.
Conclusion
You now know how to query all domains and return the resolved IPs for cPanel WHM servers.

👀 Choose SSD-powered VPS servers for increased speed, power, and security! Now 50% off- starting from only $3.19/mo.