Nameserver setup on 2 Plesk servers

http://forum.swsoft.com/showthread.php?t=38404&highlight=chroot

1.) MySQL Access Rights

On your Plesk server:
Create a MySQL user eg.: secondarydns
Using phpmyadmin, grant this user the SELECT option only for the table domains of the psa database.
Also for maximum security you should set the hostname from which this user will logon.

2.) Secondary Nameserver

Copy secondary.pl to a secure directory eg. “/root”
Make secondary.pl executable by issuing the following command “chmod 755 secondary.pl”

Now you can configure secondary.pl using vi in the following area

######## CONFIGURATION ##################################################
######

my $dbname = “psa”; # PLESK Database
my $username = “secondarydns”; # User for query only the DNS->Domain
my $pw = “xxxxxxx”; # Password
my $dbhost = “xxx.xxx.xx.xxx”; # PLESK DB Host
my $masters = “xxx.xxx.xx.xxx”; # IP Of Primary Master Nameserver
my $namedreload = “/etc/init.d/named reload”; # Command to Reload the Named Config
my $configfile = “/var/lib/named/etc/named.plesksec”; # Named Include File

##################################################
#############################

I you run a chrooted version of BIND issue the command “touch //etc/named.plesksec” to create
a Dummy file.

Now you can test your script configuration by issuing the command:
./secondary.pl
If everything went fine, you must also be able to view the created file under $configfile

Now you can add the following lines to your /etc/named.conf file

## PSA SECONDARY ZONES
include “/etc/named.plesksec”;
## /PSA

Finally restart named by issuing “/etc/init.d/named restart”

You can also set the script to run with crontab. The script will automatically restart
named every time it is run in order for it to re-read it’s configuration.

Join the Conversation

1 Comment

Leave a comment