As a sysadmin, for some reason, I needed to find the IP address my websites were using on cPanel. This is probably a hard way but it works.
A huge amount of information is stored in the cPanel user file. Here’s a sample:
$ cat /var/cpanel/users/testusername #cPanel — If you edit this file directly you must run /scripts/updateuserdomains after to rebuild the cache
BWLIMIT=5242880000
CONTACTEMAIL=admin@domain.com.au
CONTACTEMAIL2=
DEMO=0
DNS=primarydomain.com.au
FEATURELIST=default
HASCGI=0
IP=123.45.67.89
LANG=english
MAXADDON=5
MAXFTP=5
MAXLST=5
MAXPARK=5
MAXPOP=5
MAXSQL=5
MAXSUB=5
OWNER=root
PLAN=simple
RS=x3
STARTDATE=1238043252
USER=testusername
When you start parking domains and using addon domains, they also appear under this file as DNS1=domain.com, etc.
I use this command to extract the IP address out of this file.
$ cat /var/cpanel/users/putusernamehere | grep ‘IP=’ | cut -d’=’ -f2
123.45.67.89
Thanks
