Add TXT records in bulk

Hello,
I have more than 100 domains working with hestia.
Need to add the same TXT records for all. ¿it´s possible to do this in bulk mode or need to do one per one?

Thanks!

Are they for each domain the same?

If so you can write a bash script that does the trick

1 Like

Hi Eris!
Thanks for response.
Yes. The TXT records is the same for all domains.

About write a bash script… sorry but this is new for me.
Have any manuals in hestia help document to do this step by step.
This bash script add and working in my hestia panel directly or need to do this on my server? Stay now with Oracle Cloud free tier.

Only need add a TXT record with similar Value to this: 437406e5b9b67241e123s
No have to write Priority or TTL for domains, only the Value.

We can’t help you out with bash coding, but this should bring you a bit forward:

https://docs.hestiacp.com/admin_docs/api.html
https://docs.hestiacp.com/cli_commands.html

In special the following command: v-acknowledge-user-notification — Hestia Control Panel documentation

Loop this trough your records.

1 Like

Thanks for links.
Review all and investigate to do a bash script in hestia.
I search in the forum for similar thread but nothing found.

#!/bin/bash

for user in $($HESTIA/bin/v-list-users plain | cut -f1); do 
    for domain in $($HESTIA/bin/v-list-dns-domains $user plain | cut -f1); do
         echo $user $domain 
         $HESTIA/bin/v-add-dns-record $user $domain "@" "TXT" "437406e5b9b67241e123s"
    done
done 

Should probally work fine. Have not tested it …

1 Like

Ohh many thanks eris!
Only one question… To run and test this code in my panel? :sweat_smile:
it´s via Rest Api with this manual? Rest Api — Hestia Control Panel documentation

I am very amateur with this sorry.
If have a link to small manual to review to do this I would appreciate.

Regards.

No login via ssh.
Create a new file: update_dns.sh and copy past the contents the code block and then run:

bash update_dns.sh

If it shows an error file not found add

HESTIA="/usr/local/hestia/" before the for loop.

1 Like

Thanks eris!
Go with test with your code this afternoon.

Many thanks for all.

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