| | |
| | | $host="localhost"; |
| | | $user="root"; |
| | | $password="MYSQL-ROOT-PASSWD"; |
| | | mysql_connect($host,$user,$password) or die(mysql_error()); |
| | | mysql_connect($host, $user, $password) or die(mysql_error()); |
| | | |
| | | mysql_select_db("dbispconfig"); |
| | | $sql1 = mysql_query("SELECT id, substr(origin,1, LENGTH(origin)-1) AS origin, substr(ns,1, LENGTH(ns)-1) AS ns, substr(mbox,1, LENGTH(mbox)-1) AS mbox,ttl FROM dns_soa order by id asc;"); |
| | | mysql_select_db("powerdns"); |
| | | while($row1 = mysql_fetch_array($sql1)) |
| | | { |
| | | mysql_query("INSERT INTO domains (id,name,type,ispconfig_id) values ('$row1[id]','$row1[origin]','NATIVE','$row1[id]');"); |
| | | mysql_query("INSERT INTO records (domain_id,name,content,ispconfig_id,type,ttl,prio,change_date) values ('$row1[id]','$row1[origin]','$row1[ns] $row1[mbox] 0','$row1[id]','SOA','$row1[ttl]','0','1260446221');"); |
| | | mysql_query("INSERT INTO domains (id,name,type,ispconfig_id) values ('$row1[id]','$row1[origin]','NATIVE','$row1[id]');"); |
| | | mysql_query("INSERT INTO records (domain_id,name,content,ispconfig_id,type,ttl,prio,change_date) values ('$row1[id]','$row1[origin]','$row1[ns] $row1[mbox] 0','$row1[id]','SOA','$row1[ttl]','0','1260446221');"); |
| | | } |
| | | |
| | | mysql_select_db("dbispconfig"); |
| | |
| | | mysql_select_db("powerdns"); |
| | | while($row2 = mysql_fetch_array($sql2)) |
| | | { |
| | | if (strlen($row2['name'])) |
| | | { |
| | | $file1=substr($row2['data'], -1); |
| | | if ($file1==".") |
| | | { |
| | | $text = $row2['data']; |
| | | $laenge = strlen($row2['data'])-1; |
| | | $file2 = substr($text, 0,strlen($text)-1); |
| | | } |
| | | else |
| | | { |
| | | $file2=$row2['data']; |
| | | } |
| | | mysql_select_db("dbispconfig"); |
| | | $sql3 = mysql_query("SELECT substr(origin,1, LENGTH(origin)-1) AS origin FROM dns_soa where id=$row2[zone];"); |
| | | $row3 = mysql_fetch_array($sql3); |
| | | mysql_select_db("powerdns"); |
| | | mysql_query("INSERT INTO records (domain_id,name,content,ispconfig_id,type,ttl,prio,change_date) values ('$row2[zone]','$row2[name].$row3[origin]','$file2','$row2[id]','$row2[type]','$row2[ttl]','$row2[aux]','1260446221');"); |
| | | } |
| | | else |
| | | { |
| | | $file1=substr($row2['data'], -1); |
| | | if ($file1==".") |
| | | { |
| | | $text = $row2['data']; |
| | | $laenge = strlen($row2['data'])-1; |
| | | $file2 = substr($text, 0,strlen($text)-1); |
| | | } |
| | | else |
| | | { |
| | | $file2=$row2['data']; |
| | | } |
| | | mysql_select_db("dbispconfig"); |
| | | $sql3 = mysql_query("SELECT substr(origin,1, LENGTH(origin)-1) AS origin FROM dns_soa where id=$row2[zone];"); |
| | | $row3 = mysql_fetch_array($sql3); |
| | | mysql_select_db("powerdns"); |
| | | mysql_query("INSERT INTO records (domain_id,name,content,ispconfig_id,type,ttl,prio,change_date) values ('$row2[zone]','$row3[origin]','$file2','$row2[id]','$row2[type]','$row2[ttl]','$row2[aux]','1260446221');"); |
| | | } |
| | | if (strlen($row2['name'])) |
| | | { |
| | | $file1=substr($row2['data'], -1); |
| | | if ($file1==".") |
| | | { |
| | | $text = $row2['data']; |
| | | $laenge = strlen($row2['data'])-1; |
| | | $file2 = substr($text, 0, strlen($text)-1); |
| | | } |
| | | else |
| | | { |
| | | $file2=$row2['data']; |
| | | } |
| | | mysql_select_db("dbispconfig"); |
| | | $sql3 = mysql_query("SELECT substr(origin,1, LENGTH(origin)-1) AS origin FROM dns_soa where id=$row2[zone];"); |
| | | $row3 = mysql_fetch_array($sql3); |
| | | mysql_select_db("powerdns"); |
| | | mysql_query("INSERT INTO records (domain_id,name,content,ispconfig_id,type,ttl,prio,change_date) values ('$row2[zone]','$row2[name].$row3[origin]','$file2','$row2[id]','$row2[type]','$row2[ttl]','$row2[aux]','1260446221');"); |
| | | } |
| | | else |
| | | { |
| | | $file1=substr($row2['data'], -1); |
| | | if ($file1==".") |
| | | { |
| | | $text = $row2['data']; |
| | | $laenge = strlen($row2['data'])-1; |
| | | $file2 = substr($text, 0, strlen($text)-1); |
| | | } |
| | | else |
| | | { |
| | | $file2=$row2['data']; |
| | | } |
| | | mysql_select_db("dbispconfig"); |
| | | $sql3 = mysql_query("SELECT substr(origin,1, LENGTH(origin)-1) AS origin FROM dns_soa where id=$row2[zone];"); |
| | | $row3 = mysql_fetch_array($sql3); |
| | | mysql_select_db("powerdns"); |
| | | mysql_query("INSERT INTO records (domain_id,name,content,ispconfig_id,type,ttl,prio,change_date) values ('$row2[zone]','$row3[origin]','$file2','$row2[id]','$row2[type]','$row2[ttl]','$row2[aux]','1260446221');"); |
| | | } |
| | | } |
| | | |
| | | mysql_select_db("powerdns"); |
| | |
| | | |
| | | while($row4 = mysql_fetch_array($sql4)) |
| | | { |
| | | mysql_query("UPDATE records SET content = '$row4[content].$row4[name]' where id='$row4[id]';"); |
| | | mysql_query("UPDATE records SET content = '$row4[content].$row4[name]' where id='$row4[id]';"); |
| | | } |
| | | |
| | | |
| | | ?> |
| | | ?> |