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!

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:
    156
    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

  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