[Pdns-users] Re my Windows 2000 migration to PDNS

Mathew Walker mat at hypermax.net.au
Wed Nov 19 04:54:38 UTC 2003


Hi Guys,

	Just to let you know, I've had major success with importing my 1000 
domains from my Windows 2000 name
	server to PDNS.

	Firstly I SMB mounted the /system32/dns directory on my PDNS Linux server. 
(Keep in mind for Win2K DNS,
	that when you deleted a domain from the DNS Console it doesnt delete the 
domain file!) Because some old
	DNS files existed in the /system32/dns directory, I went to the DNS 
Console in W2K and exported a current
	list of domains. I then "cat domainlist | awk {'print $1'} > importlist" 
to give me a single column of domains
	ready to import.

	Then I made a bash script:

#!/bin/bash
DOMAINARRAY=`cat /mnt/samba/winnt/system32/dns/domainlist`
for domainname in $DOMAINARRAY
do

echo " "
echo "$domainname being imported"
zone2sql --zone=$domainname.dns --gmysql --zone-name=$domainname | mysql -h 
10.10.1.1 -D pdns -u pdns
echo "$domainname done!"
echo " "

done
exit 0


	Which basically read each domain from the domainlist file and then 
imported the .dns file in the /system32/dns
	directory using zone2sql and then piped to mysql for input into the database.

	Yeah, I could have probably scripted it a little better, but it was a 
quick and dirty job and it worked a treat.

	I also discovered that the auto increment ID field in mySQL continues to 
rise even after you delete ever record.
	I found how to reset this too.

Cheers,

Mathew




More information about the Pdns-users mailing list