Create subdomains in bulk

I have to create more than 100 subdomains, is there any way to pass a list and create them all at once?

you can use the rest api to loop through the list: Rest Api — Hestia Control Panel documentation

1 Like

Or use a bash script that reads a file and loops trough it

Loop as @eris says with this command:

create a file called file.txt with:

sub1.domain.com
sub2.domain.com
sub3.domain.com
sub4.domain.com

This untested script could work:

#!/bin/bash
username= feliperbb9
for subdomain in $(cat file.txt); do
$HESTIA/bin/v-add-web-domain $username $subdomain
done

If you want to create a new user for each subdomain then:

#!/bin/bash
for subdomain in $(cat file.txt); do
$HESTIA/bin/v-add-user $subdomain $hst_password $hst_email $hst_plan
$HESTIA/bin/v-add-web-domain $subdomain $subdomain
done
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.