Skip to main content

XML-API: List all domains on a server along with their assigned IP

Comments

3 comments

  • KostonConsulting
    [quote="stards, post: 1547572">Hi Is there a way to list all domains on a server along with their cpanel-assigned IP?
    You'd think so but frustratingly, something so simple is not available. There's listaccts ([url=http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/ListAccounts]List Accounts) which will show the primary domain and IP for each account but it does not provide sub/parked/addon domains. The only place in the UI that shows all domains and their IPs is https://:2087/cpsessXXXXXX/scripts/ipusage You could parse this page for the information. You could also write your own custom API module to gather this data: [url=http://docs.cpanel.net/twiki/bin/vief/SoftwareDevelopmentKit/WritingCpanelModules]Writing cPanel Modules [QUOTE] I know there's "resolvedomainname?api.version=1&domain=example.com" but this one does a DNS resolve (not a straight out pull from the cpanel server itself like httpd.conf). I'd hate to have to pull info out of vhosts from httpd.conf. There's this perl module: /usr/local/cpanel/Cpanel/UserDomainIp.pm Is there way to leverage this piece of code reliably without it breaking in the future? If so what's the proper way to pull the info out? Please help! Thanks
    You could write a custom API module that is a wrapper around UserDomainIP::getdomainip(). However, there's no guarantee that this function won't change in the future (though it hasn't in a long time). Custom API module docs: [url=http://docs.cpanel.net/twiki/bin/vief/SoftwareDevelopmentKit/WritingCpanelModules]Writing cPanel Modules
    0
  • stards
    [quote="KostonConsulting, post: 1547852"> You could also write your own custom API module to gather this data: [url=http://docs.cpanel.net/twiki/bin/vief/SoftwareDevelopmentKit/WritingCpanelModules]Writing cPanel Modules You could write a custom API module that is a wrapper around UserDomainIP::getdomainip(). However, there's no guarantee that this function won't change in the future (though it hasn't in a long time). Custom API module docs: [url=http://docs.cpanel.net/twiki/bin/vief/SoftwareDevelopmentKit/WritingCpanelModules]Writing cPanel Modules
    Thanks! At the very least now I have a sense of direction...
    0
  • cPanelMichael
    [quote="stards, post: 1547971">Thanks! At the very least now I have a sense of direction...
    Note that you are also welcome to open a feature request to see a more direct way of obtaining this information through our API: Submit A Feature Request Thank you.
    0

Please sign in to leave a comment.