• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Plesk Bind master + PDNS slaves zone transfer

Andriy_Martynyuk

New Pleskian
Hi guys,

I'm experiencing the situation with zone transfer to PDNS slaves.

// $Id: named.conf,v 1.1.1.1 2001/10/15 07:44:36 kap Exp $

// -- THE FOLLOWING LINES WERE GENERATED BY PLESK. IF YOU MODIFY THEM, THEY WILL BE OVERWRITTEN WHEN THESE SETTINGS ARE MANAGED IN PLESK UI. --
options {
allow-recursion {
localnets;
};
notify yes;
also-notify {
SLAVE_IP_1;
SLAVE_IP_2;
};
listen-on-v6 { any; };
version "none";
directory "/var";
auth-nxdomain no;
pid-file "/var/run/named/named.pid";
};

key "rndc-key" {
algorithm hmac-md5;
secret "<key-here>";
};

controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};

zone "." {
type hint;
file "named.root";
};

zone "0.0.127.IN-ADDR.ARPA" {
type master;
file "localhost.rev";
};
// -- END OF LINES GENERATED BY PLESK. --


// -- PLEASE ADD YOUR CUSTOM DIRECTIVES BELOW THIS LINE. --
// ...
// -- END OF YOUR CUSTOM DIRECTIVES. --

PDNS have slave=yes enabled and works great with PDNS master server I also have.

But, as written by PDNS community:
For example, if you use ns1.solcon.nl as primary NS-record you need to
have ‘ns1.solcon.nl’ as the nameserver-record in de supermasters-table.

So I've added a small script to crontab updating supermasters table every n minutes:
#!/bin/bash
#Update PDNS Slave servers
pleskIP="plesk_IP"
DNSServerlist="slave_ip_1 slave_ip_2"
domainslist=`grep "zone" /etc/named.conf | grep -v "\(ARPA\|arpa\)" | awk -F\" '{if(NR>1)print $2 '}`
for i in $DNSServerlist; do
for count in $domainslist; do
domainns=ns.$count
echo "INSERT INTO supermasters (ip,nameserver) \
SELECT * FROM (SELECT '$pleskIP','$domainns') AS tmp \
WHERE NOT EXISTS (SELECT nameserver FROM supermasters WHERE nameserver = '$domainns') LIMIT 1;" | mysql -u pdns -h $i -pdecafoumookeness pdns
#echo $domainns $i
done
done
/etc/init.d/named reload
namedconfcheck=`grep "notify yes" /var/named/chroot/etc/named.conf`
if [ "$namedconfcheck" != " notify yes;" ]; then
echo "Please check /var/named/chroot/etc/named.conf to be sure all SLAVE DNS get updates" | mail -s "`uname -n` WARNING: named.conf \"notify\" not present" my@mail.box
fi

It successfully updates supermasters table but does not send zone updates.
But when I do /etc/init.d/named restart all records are transfered. But restarting bind just by crontab is not a good solution...

So I've thought maybe you could help me with finding of domain creation script so I could modify it to run my script before it restarts Bind, or maybe drive me to other solution.

Thank you.
 
You can try to call

# /usr/local/psa/admin/bin/dnsmng --update domain.name

or

for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/admin/bin/dnsmng --update $i; done

for updating and transferring zones of all domains.
 
Back
Top