Grant Klaaysen
My feedback
1 result found
-
14 votes
Thank you for your input! We will consider this functionality in upcoming releases if it will be popular.
Everyone, please continue voting for this feature if you consider it important.
— AY
An error occurred while saving the comment An error occurred while saving the comment Grant Klaaysen commentedScript File attached hopefully this time.
An error occurred while saving the comment Grant Klaaysen commentedHi guys,
Further to this topic we have created a script that will automate the post migration process with updating the name servers to get the dns data from the new master server.
The script will lookup the Plesk Slave DNS settings to work out how many slave dns servers you have and where they are.
Syntax is from an SSH session:
plesk_recreate_slave_zones.sh example.comOf course please review the script, we give no warranties but I have been using it and it has been working well.
Plesk Team, can you please review and incorporate this script onto your code?
Or give us an option to run a script as a post migration feature.This would just make the Plesk to Plesk migration tool completed and fully automated when using the Plesk Slave DNS Extension.
Thanks Tully who put this script together for me. :)
Regards,
GrantGrant Klaaysen supported this idea ·An error occurred while saving the comment Grant Klaaysen commentedPerfect, this is exactly what I am looking for and agree it could be so simple to implement.
Post migration of the domain the migration tool just needs to do the rndc delzone and rndc addzone as you have highlighted.
That small change would make a massive improvement to the migration work and make it super simple to do.
Please add this feature or let us know if we could add some code to the post migration settings to execute the rndc commands.
Am having issues attached the script file even when zipped.
Please see below code if you want to make your own script.
-------------------------------------------------------------------------------
#!/bin/bash
# ---
# Script to recreate Plesk ***** DNS zones on all nameservers using rsync commands - delzone, addzone and refreshzone
# Copyright (C) 2020 GPK Group Pty Ltd (www.gpkgroup.com.au)
# Permission to copy and modify is granted under the BSD license
# Last revised 28/04/2020
#
# Usage: plesk_recreate_slave_zones.sh domain.com.au
# Get the specified domain name
DOMAIN_NAME=$1
if [ -z $DOMAIN_NAME ]
then
echo "Error: no domain was specified"
exit 1
fi
DIRECTORY=/usr/local/psa/var/modules/*****-dns-manager
# Find all *.conf files
files=($DIRECTORY/*.conf)
for file in ${files[@]}
do
failed=0
FILE_CONTENT="$(cat $file)"
# Extract server IP from file
SERVER_IP=$(grep -A1 "For example:$" $file | grep -oP '(?<=\-b )([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})')
if [ $? -eq 1 ]
then
echo "Error: Plesk server IP was not found in $file"
failed=1
fi
NAMESERVER_IP=$(grep -A1 "For example:$" $file | grep -oP '(?<=\-s )([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})')
if [ $? -eq 1 ]
then
echo "Error: ***** nameserver IP was not found in $file"
failed=1
fi
if [ $failed -eq 0 ]
then
echo "Recreating DNS zone $DOMAIN_NAME on ***** nameserver $NAMESERVER_IP for Plesk server $SERVER_IP"
# Delete
/usr/sbin/rndc -b $SERVER_IP -s $NAMESERVER_IP -p "953" -y "rndc-key" -c $file delzone -clean $DOMAIN_NAME
sleep 5
# Create
/usr/sbin/rndc -b $SERVER_IP -s $NAMESERVER_IP -p "953" -y "rndc-key" -c $file addzone $DOMAIN_NAME "{ type *****; file \"$DOMAIN_NAME\"; masters { $SERVER_IP; }; };"
sleep 5
# Refresh
/usr/sbin/rndc -b $SERVER_IP -s $NAMESERVER_IP -p "953" -y "rndc-key" -c $file refresh $DOMAIN_NAME
fi
done