Skip to main content

What file contains a list of usernames and the main account domain?

Comments

4 comments

  • sparek-3
    cat /var/cpanel/users/%user% | grep ^DNS= | sed s/^DNS=//g
    0
  • Ishware
    You are magic. Thank you so so very much. :)
    0
  • 24x7server
    Any ideas?

    There is much simpler way than using a complex sed and grep combination when there is already a file that has the data that you are looking for. /etc/userdomains contains list of all Addon and Subdomain. If you want just get a list of main account and its user, use trueuserdomains. # cat /etc/trueuserdomains This is the file that contains a list of the main domain and their respective usernames..
    0
  • cPWilliamL
    Just to follow up with a few examples: # whmapi1 listaccts search='^cptest$' searchtype=user|grep -oP '(?<=domain: ).+' cptest.tld # grep -oP "[^:]+(?=: cptest$)" /etc/trueuserdomains cptest.tld
    0

Please sign in to leave a comment.