Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Plesk windows server and I want it to work with my 3 existing nameservers. I have configured the name-servers to accept zone-files exported from the Windows server but I do not know how to make the windows server export zone files to them. My research has led to making a batch file which I schedule with the windows task scheduler.

My questions are:

1)What is the location of Plesk zone files on a Windows 2008 R2 Plesk server? 2)What do I include in the batch file to achieve this? I need a typical zone exporting script.

Thanks

share|improve this question

2 Answers 2

1) C:\Program Files (x86)\Parallels\Plesk\dns\var\ is the location for the Zone file on my test server for a test domain.

share|improve this answer
up vote 0 down vote accepted

SCRIPT 1) Install Unxtils In the directory I have installed c:\UnxUtils\bin\sh\ (its the default) which I downloaded from http://www.redantigua.com/unxutils-win.html

2) Using notepad add the script to the zone directory and name it appropriately (e.g gen-secondaries.sh)

 #!/bin/sh
MASTER=10.1.1.1 ( IP of your server)
NAMED_ROOT=c:/program files (x86)/Parallels/Plesk/dns/etc/
HTTPDOCS=c:/inetpub/vhosts/default/htdocs
egrep "^zone" $NAMED_ROOT/named.conf |egrep -iv "arpa|\"\." | gawk -F\" '{print $2}' > $NAMED_ROOT/domains
echo > $HTTPDOCS/secondariescp8.txt
for i in `cat $NAMED_ROOT/domains`; do
echo "zone \"$i\" {" >> $HTTPDOCS/
echo " type slave; " >> $HTTPDOCS/secondariescp8.txt
echo " file \"/var/named/slaves/$i.hosts\";" >> $HTTPDOCS/secondariescp8.txt
echo " masters { $MASTER; };" >> $HTTPDOCS/secondariescp8.txt
echo " allow-transfer { none; };" >> $HTTPDOCS/secondariescp8.txt
echo "};" >> $HTTPDOCS/secondariescp8.txt
echo >> $HTTPDOCS/secondariescp8.txt
done
chmod 644 $HTTPDOCS/secondariescp8.txt

NB secondariescp8.txt is where I store my zone files.

3) Schedule the script. I used Plesk scheduler wit the arguments below:

  • Path to executable file *:C:\UnxUtils\bin\sh.exe
  • Arguments:"C:\Program files (x86)\Parallels\Plesk\dns\etc\gen-secondaries.sh"

Hope this helps someone with a similar problem.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.