• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Bulk update DNS records

AndorA

Basic Pleskian
A feature request for something that I always assumed would be possible - until I needed it.

For the CLI of Plesk, it would be great if we could script the updating of DNS records. This is useful, for example, when moving the mailserver for a bunch of domains to a different machine and hence all 'mail' records needs to be updated.

There currently is the --add command, which works as expected. However, the --set and the --del options for records are flawed to the extend of being unusable.

The --set option seems great, but as an added 'feature' it will delete each and every record of your zone that you do not explicitly set. So you have to write out the entire zone with all resource records in order to use it. That is a little extreme. For updating just one record (such as the mail or the ns records) it is therefore completely unusable.

A combination of the --del and --add option would do the same thing: you could simply delete the old 'mail' record, and then add the new one. But --del only works if you specify the exact current values. To stick to our example, you cannot just delete all 'mail' records, you have to specify the exact IP that mail record is current set to. Since that requires finding out this value for each and every domain before you can run your script, it is actually easier to just use the graphical interface and spend hours on updating hundreds of domains. At least then you have the option of changing a value, and you don't need to look up all current values first, but you can do it one go.

So to summarize, my feature request is on of the following:
A --set function that does not delete all records in your zone while updating just one record (perhaps --update?)
A --del function that just deletes all records you specify, without having to specify the exact current values.

That way you can actually use the Plesk CLI to manage DNS without having to use the UI when you want to update an series of existing records.

Regs,
Andor
 
You can just write some script with combination of selection needed records from psa database and update them with CLI utility. I'm not familiar with Windows scripting but it is easily in Linux. For example:

# mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e 'select name from domains where name="mail.%"' | awk '{print "/usr/local/psa/admin/sbin/dnsmng update " $1 }' | sh

or something like that.
 
Thanks Igor!

I also thought of that solution. But since you have such a nice CLI, I figured it makes sense to update it. It is not all that logical to have to hack into the PSA database for something that should be basic functionality of the CLI. I would be able to do this, but you shouldn't have to know MySQL or need to have the PSA password in order to use the CLI, I feel.

So while I do thank you for your constructive solution, my feature request still stands :)
 
Back
Top