Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How many domains/vhost ?

Discussion in 'General Discussion' started by MaRiOsGR66, Jul 12, 2011.

  1. MaRiOsGR66

    MaRiOsGR66 Well-Known Member

    Joined:
    Feb 18, 2011
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    66
    cPanel Access Level:
    Root Administrator
    Hello,

    how can I see how many domains/vhosts are setup in the cpanel server? Account Information -> List Accounts shows the account number but an account could have many domains (as addons).
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    This command in root SSH could give you a good idea of the number of domains on the machine, which will include subdomains, addon domains and parked domains:

    Code:
    grep ^DNS /var/cpanel/users/* | wc -l
    Alternatively, you can try using /etc/userdcomains:

    Code:
    cat /etc/userdomains | wc -l
    The following will provide a list of all domains under all users with the path to the user's file:

    Code:
    grep ^DNS /var/cpanel/users/*
    The following will simply provide a list of all domains:

    Code:
    grep ^DNS /var/cpanel/users/* | cut -d= -f2
    If you want any of these to output to a file, you can add "> /root/listdomains.txt" to the command such as:

    Code:
    grep ^DNS /var/cpanel/users/* | cut -d= -f2 > /root/listdomains.txt
    Additionally, this can also be obtained from /etc/userdomains:

    Code:
    cat /etc/userdomains
    To just get a listing of the domains:

    Code:
    cat /etc/userdomains | cut -d: -f1
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. MaRiOsGR66

    MaRiOsGR66 Well-Known Member

    Joined:
    Feb 18, 2011
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    66
    cPanel Access Level:
    Root Administrator
    thank you very much
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice