Hi Insider,
Your script worked great!
I used it to change bulk a-records.
But it allready changed after the rule: update dns_recs set displayVal = 'ns1.new.tld.', val = 'ns1.new.tld.' where type = 'NS' and val='ns1.old.tld.';
Why is there the need to run the script after?
Because when I run this script, then I get the following error:
dnsmng: Some parameters in command string are left unprocessed. Check parameters please.
System error 2: No such file or directory
domain.com
Did you know why? Or what to do.
And is there the need to run the script after?
Best regards,
-->> UPDATE
I find also the following script, and this works good!
Is this the same?
#!/bin/sh
ADMIN_PASS=`cat /etc/psa/.psa.shadow`
MYSQL_BIN_D=`grep MYSQL_BIN_D /etc/psa/psa.conf | awk '{print $2}'`
mysql="${MYSQL_BIN_D}/mysql -N -uadmin -p${ADMIN_PASS} psa"
query="select name from domains;"
domains=`echo $query | $mysql `
for i in ${domains}; do
echo "echo $i"
/usr/local/psa/admin/sbin/dnsmng --update $i
done
First you should update Server Settings > DNS Template in Plesk Panel.
Then you should make modifications in database psa table dns
mysql> update dns_recs set displayVal = 'ns1.new.tld.', val = 'ns1.new.tld.' where type = 'NS' and val='ns1.old.tld.';
After that you may use following script from your Plesk server:
#!/bin/bash
ADMIN_PASS=`cat /etc/psa/.psa.shadow`
MYSQL_BIN_D=`grep MYSQL_BIN_D /etc/psa/psa.conf | awk '{print $2}'`
mysql="${MYSQL_BIN_D}/mysql -N -uadmin -p${ADMIN_PASS} psa"
UNIXTST=`date +%s`
NORMTST=`date +%Y%m%d%M`
# Updating SOA serial record
querytimeu="update dns_zone set serial=$UNIXTST where serial_format='UNIXTIMESTAMP';"
querytimen="update dns_zone set serial=$NORMTST where serial_format='YYYYMMDDNN';"
echo $querytimeu | $mysql
echo $querytimen | $mysql
query="select name from domains;"
query2="select name from domainaliases;"
domains=`echo $query | $mysql `
daliases=`echo $query2 | $mysql `
echo "Updating zones for following domains"
echo "-----------------------------------------------------------------"
for i in ${domains}; do
echo "$i"
/usr/local/psa/admin/sbin/dnsmng update $i
done
echo "-----------------------------------------------------------------"
echo "All domains have been updated"
echo "Updating zones for following aliases"
echo "-----------------------------------------------------------------"
for i in ${daliases}; do
echo "$i"
/usr/local/psa/admin/sbin/dnsmng update $i
done
echo "-----------------------------------------------------------------"
echo "All aliases have been updated"