The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    92
    Likes Received:
    0
    Trophy Points:
    6
    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,623
    Likes Received:
    21
    Trophy Points:
    38
    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
     
  3. MaRiOsGR66

    MaRiOsGR66 Well-Known Member

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

Share This Page