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.

Getting ONLY addon domains list - not subdomains!

Discussion in 'General Discussion' started by garak, Aug 11, 2008.

  1. garak

    garak Active Member

    Joined:
    Jan 23, 2004
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Hello!

    I saw here in this forum the following command to get a list of a user's domains:

    cat /var/cpanel/users/user | grep DNS | awk -F [=] '{print $2}'

    And it works!

    The only problem is that I only need the first level domains names, not the subdomains.

    For example... the command above prints everything:

    masterdomain.com
    addon.masterdomain
    addon.net


    And I just need:

    masterdomain.com
    addon.net


    Someone can help me?

    Thank you so much in advance!
     
Loading...

Share This Page