Current time: 12-26-2024, 12:23 AM Hello There, Guest! (LoginRegister)


Post Reply 
[HowTo] powerdns and isp-control
Author Message
uwe Offline
Junior Member
*

Posts: 68
Joined: Feb 2008
Reputation: 0
Post: #10
RE: [HowTo] powerdns and isp-control
Quote:for store in pdns.records (not all the statements but you see how i do it)
only the first 2 statements works an i not know why

Code:
my ($myrdatsoa,$myrdatns1, $myrdatns2, $myrdatmx1, $myrdata1, $myrdata2)  = (undef, undef, undef, undef, undef, undef);
        ($rs, $myrdatsoa) = doSQL("SELECT IF(
                                        (SELECT t2.id FROM pdns.records t2 WHERE t2.name = '$dmn_name' AND TYPE = 'SOA')>0,
                                        (SELECT t2.id FROM pdns.records t2 WHERE t2.name = '$dmn_name' AND TYPE = 'SOA'),
                                        'NULL')"
                               );
#        return $rs if ($rs != 0);
        doSQL("INSERT INTO pdns.records(id, domain_id, name, type, content, ttl, prio, change_date)
               SELECT '$myrdatsoa', t1.id,  '$dmn_name', 'SOA', concat( 'ns1.deltaweb.de. hostmaster.deltaweb.de.',
                        CURDATE( ) +0, '00 86400 7200 604800 1800' ) , 21600, 0, Unix_timestamp( )
               FROM pdns.domains t1 where t1.name = '$dmn_name'
               ON DUPLICATE KEY UPDATE name =  '$dmn_name', domain_id = t1.id, type = 'SOA',
                        content = concat('ns1.deltaweb.de. hostmaster.deltaweb.de.',CURDATE() + 0,'00 86400 7200 604800 1800'),
                        ttl= 21600,
                        prio=0,
                        change_date = Unix_timestamp()"
             );
        ($rs, $myrdatns1) = doSQL("SELECT IF(
                                (SELECT t2.id FROM pdns.records t2 WHERE t2.name = '$dmn_name' AND t2.type = 'NS' AND t2.content = 'ns1.deltaweb.de')>0,
                                (SELECT t2.id FROM pdns.records t2 WHERE t2.name = '$dmn_name' AND t2.type = 'NS' AND t2.content = 'ns1.deltaweb.de'),
                                 'NULL')"
                               );
#        return $rs if ($rs != 0);
        doSQL("INSERT INTO pdns.records(id, domain_id, name, type, content, ttl, prio, change_date)
               SELECT '$myrdatns1', t1.id,  '$dmn_name', 'NS', 'ns1.deltaweb.de', ) , 21600, 0, Unix_timestamp( )
               FROM pdns.domains t1 where t1.name = '$dmn_name'
               ON DUPLICATE KEY UPDATE name =  '$dmn_name', domain_id = t1.id, type = 'NS',
                        content = 'ns1.deltaweb.de',
                        ttl= 21600,
                        prio=0,
                        change_date = Unix_timestamp()"
             );

        ($rs, $myrdatns2) = doSQL("SELECT IF(
                                 (SELECT t2.id FROM pdns.records t2 WHERE t2.name = '$dmn_name' AND t2.type = 'NS' AND t2.content = 'ns2.deltaweb.de')>0,
                                 (SELECT t2.id FROM pdns.records t2 WHERE t2.name = '$dmn_name' AND t2.type = 'NS' AND t2.content = 'ns2.deltaweb.de'),
                                 'NULL')"
                               );
#         return $rs if ($rs != 0);

I'm not sure whic statements you mean, but i think the thing is that you shouldnt inderst id for the records, since they are autoincrement .
04-02-2009 12:38 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
[HowTo] powerdns and isp-control - uwe - 07-24-2008, 08:46 PM
RE: powerdns and isp-control - BioALIEN - 07-30-2008, 01:03 AM
RE: powerdns and isp-control - uwe - 07-31-2008, 08:28 AM
RE: [HowTo] powerdns and isp-control - uwe - 04-01-2009, 07:13 PM
RE: [HowTo] powerdns and isp-control - uwe - 04-01-2009, 08:16 PM
RE: [HowTo] powerdns and isp-control - uwe - 04-02-2009 12:38 AM
RE: [HowTo] powerdns and isp-control - uwe - 05-04-2009, 12:14 AM
RE: [HowTo] powerdns and isp-control - uwe - 05-09-2009, 04:19 PM
RE: [HowTo] powerdns and isp-control - uwe - 05-10-2009, 05:33 PM
RE: [HowTo] powerdns and isp-control - uwe - 05-12-2009, 07:12 AM
RE: [HowTo] powerdns and isp-control - uwe - 07-01-2009, 11:04 PM

Forum Jump:


User(s) browsing this thread: 5 Guest(s)