Skip to main content

Get all domains and subdomains

Comments

3 comments

  • cPRex Jurassic Moderator
    Hey there! What about this command? whmapi1 get_domain_info
    This will return the following block of text for each domain on the server: docroot: /home/username/public_html domain: domain.com domain_type: main ipv4: 1.2.3.4 ipv4_ssl: 1.2.3.4 ipv6: ~ ipv6_is_dedicated: 0 modsecurity_enabled: 1 parent_domain: domain.com php_version: ea-php72 port: 80 port_ssl: 443 user: username user_owner: root
    The user_owner field would tell you if this was owned by a certain reseller account. Let me know if that works!
    0
  • zerros
    I'm not root on the server. I don't have this command available. I use the UAPI from my laptop. This is my code: echo "############################" echo "# List accounts" echo "############################" curl -qs -X POST -H "Authorization: cpanel $CPANEL_CREDENTIALS" "https://${URL}/execute/Resellers/list_accounts" | jq . echo echo "############################" echo "# List domains" echo "############################" curl -qs -X POST -H "Authorization: cpanel $CPANEL_CREDENTIALS" "https://${URL}/execute/DomainInfo/list_domains" | jq . echo echo "############################" echo "# Get usage" echo "############################" curl -qs -X POST -H "Authorization: cpanel $CPANEL_CREDENTIALS" "https://${URL}/execute/ResourceUsage/get_usages" | jq . echo echo "############################" echo "# List domains for ACCOUNT1" echo "############################" curl -qs -X POST -H "Authorization: cpanel $ACCOUNT1_CREDENTIALS" "https://${URL}/execute/DomainInfo/list_domains" | jq . echo echo "############################" echo "# List domains for ACCOUNT2" echo "############################" curl -qs -X POST -H "Authorization: cpanel $ACCOUNT2_CREDENTIALS" "https://${URL}/execute/DomainInfo/list_domains" | jq . ... ...
    I'd like to access to all domains from the main account. I can change the context from the UI using a drop down menu. I don't know if I can do the same from the API.
    0
  • cPRex Jurassic Moderator
    I don't believe there is an API tool that will provide that level of detail if you aren't the root user, unfortunately.
    0

Please sign in to leave a comment.