Operating System & Version
CentOS 7
cPanel & WHM Version
11.92.0.5

yakatz9

Well-Known Member
Mar 16, 2010
56
4
58
cPanel Access Level
DataCenter Provider
I am writing an integration that will need a list of every hostname that the cPanel server will respond to. I know I can get this information by parsing the output of `httpd -S`, but I can't find any way of getting this in a structured format from any cPanel/WHM API. Is there any other way of getting that data? Hopefully some part of the command line API (/usr/local/cpanel/bin/whmapi1 --output=json)
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
4,357
546
273
cPanel Access Level
Root Administrator
Hey there! What about the file /etc/userdomains? That lists all the domains on the system as well as their owner, in a plain text format that is easy to interpret. You'll see the file formated like this:

domain.com: username
domain2.com: user2