How to get the main/primary domain by using any domain/subdomain name of the subscription and all domains/subdomains under the subscription via MySQL query?




  • Avatar
    John Bertin

    Neither of these commands work

  • Avatar
    Alexandr Redikultsev (Edited )

    Hi @John Bertin.

    I have just tested the commands and they seemed to work.

    I have main domain named and several other domains under that subscription: and 

    I was able to get with the first query:

    # plesk db "select name from domains where id=(select webspace_id from domains where name='";
    | name        |
    | |

    And both additional domains with this one:

    # plesk db "select name from domains where webspace_id=(select id from domains where name='')";
    | name                   |
    |            |
    |        |

    In case you want to catch some other information, please clarify it.

Please sign in to leave a comment.

Have more questions? Submit a request