@@ -265,6 +265,26 @@ public function createZone(Request $request, Response $response)
265265 }
266266 if ($ powerdnsip !== '127.0.0.1 ' && isValidIP ($ powerdnsip )) {
267267 $ config ['powerdnsip ' ] = $ powerdnsip ;
268+ $ config ['pdns_master_ip ' ] = $ powerdnsip ;
269+ }
270+ // NS2–NS13 (slaves)
271+ for ($ i = 2 ; $ i <= 13 ; $ i ++) {
272+ $ suffix = '_NS ' . $ i ;
273+
274+ $ apiKeyKey = 'API_KEY ' . $ suffix ;
275+ if (!empty ($ credentials [$ apiKeyKey ])) {
276+ $ config ['apikey_ns ' . $ i ] = $ credentials [$ apiKeyKey ];
277+ }
278+
279+ $ bindKey = 'BIND_IP ' . $ suffix ;
280+ if (!empty ($ credentials [$ bindKey ]) && isValidIP ($ credentials [$ bindKey ])) {
281+ $ config ['bindip_ns ' . $ i ] = $ credentials [$ bindKey ];
282+ }
283+
284+ $ pdnsKey = 'POWERDNS_IP ' . $ suffix ;
285+ if (!empty ($ credentials [$ pdnsKey ]) && isValidIP ($ credentials [$ pdnsKey ])) {
286+ $ config ['powerdnsip_ns ' . $ i ] = $ credentials [$ pdnsKey ];
287+ }
268288 }
269289 if ($ providerDisplay === 'ClouDNS ' ) {
270290 $ config ['cloudns_auth_id ' ] = $ cloudnsAuthId ;
@@ -617,6 +637,26 @@ public function zoneDNSSEC(Request $request, Response $response, $args)
617637 }
618638 if ($ powerdnsip !== '127.0.0.1 ' && isValidIP ($ powerdnsip )) {
619639 $ recordData ['powerdnsip ' ] = $ powerdnsip ;
640+ $ recordData ['pdns_master_ip ' ] = $ powerdnsip ;
641+ }
642+ // NS2–NS13 (slaves)
643+ for ($ i = 2 ; $ i <= 13 ; $ i ++) {
644+ $ suffix = '_NS ' . $ i ;
645+
646+ $ apiKeyKey = 'API_KEY ' . $ suffix ;
647+ if (!empty ($ credentials [$ apiKeyKey ])) {
648+ $ recordData ['apikey_ns ' . $ i ] = $ credentials [$ apiKeyKey ];
649+ }
650+
651+ $ bindKey = 'BIND_IP ' . $ suffix ;
652+ if (!empty ($ credentials [$ bindKey ]) && isValidIP ($ credentials [$ bindKey ])) {
653+ $ recordData ['bindip_ns ' . $ i ] = $ credentials [$ bindKey ];
654+ }
655+
656+ $ pdnsKey = 'POWERDNS_IP ' . $ suffix ;
657+ if (!empty ($ credentials [$ pdnsKey ]) && isValidIP ($ credentials [$ pdnsKey ])) {
658+ $ recordData ['powerdnsip_ns ' . $ i ] = $ credentials [$ pdnsKey ];
659+ }
620660 }
621661 if ($ providerDisplay === 'ClouDNS ' ) {
622662 $ recordData ['cloudns_auth_id ' ] = $ cloudnsAuthId ;
@@ -805,6 +845,26 @@ public function updateZone(Request $request, Response $response, $args)
805845 }
806846 if ($ powerdnsip !== '127.0.0.1 ' && isValidIP ($ powerdnsip )) {
807847 $ recordData ['powerdnsip ' ] = $ powerdnsip ;
848+ $ recordData ['pdns_master_ip ' ] = $ powerdnsip ;
849+ }
850+ // NS2–NS13 (slaves)
851+ for ($ i = 2 ; $ i <= 13 ; $ i ++) {
852+ $ suffix = '_NS ' . $ i ;
853+
854+ $ apiKeyKey = 'API_KEY ' . $ suffix ;
855+ if (!empty ($ credentials [$ apiKeyKey ])) {
856+ $ recordData ['apikey_ns ' . $ i ] = $ credentials [$ apiKeyKey ];
857+ }
858+
859+ $ bindKey = 'BIND_IP ' . $ suffix ;
860+ if (!empty ($ credentials [$ bindKey ]) && isValidIP ($ credentials [$ bindKey ])) {
861+ $ recordData ['bindip_ns ' . $ i ] = $ credentials [$ bindKey ];
862+ }
863+
864+ $ pdnsKey = 'POWERDNS_IP ' . $ suffix ;
865+ if (!empty ($ credentials [$ pdnsKey ]) && isValidIP ($ credentials [$ pdnsKey ])) {
866+ $ recordData ['powerdnsip_ns ' . $ i ] = $ credentials [$ pdnsKey ];
867+ }
808868 }
809869 if ($ providerDisplay === 'ClouDNS ' ) {
810870 $ recordData ['cloudns_auth_id ' ] = $ cloudnsAuthId ;
@@ -1050,6 +1110,26 @@ public function updateZoneProcess(Request $request, Response $response)
10501110 }
10511111 if ($ powerdnsip !== '127.0.0.1 ' && isValidIP ($ powerdnsip )) {
10521112 $ recordData ['powerdnsip ' ] = $ powerdnsip ;
1113+ $ recordData ['pdns_master_ip ' ] = $ powerdnsip ;
1114+ }
1115+ // NS2–NS13 (slaves)
1116+ for ($ i = 2 ; $ i <= 13 ; $ i ++) {
1117+ $ suffix = '_NS ' . $ i ;
1118+
1119+ $ apiKeyKey = 'API_KEY ' . $ suffix ;
1120+ if (!empty ($ credentials [$ apiKeyKey ])) {
1121+ $ recordData ['apikey_ns ' . $ i ] = $ credentials [$ apiKeyKey ];
1122+ }
1123+
1124+ $ bindKey = 'BIND_IP ' . $ suffix ;
1125+ if (!empty ($ credentials [$ bindKey ]) && isValidIP ($ credentials [$ bindKey ])) {
1126+ $ recordData ['bindip_ns ' . $ i ] = $ credentials [$ bindKey ];
1127+ }
1128+
1129+ $ pdnsKey = 'POWERDNS_IP ' . $ suffix ;
1130+ if (!empty ($ credentials [$ pdnsKey ]) && isValidIP ($ credentials [$ pdnsKey ])) {
1131+ $ recordData ['powerdnsip_ns ' . $ i ] = $ credentials [$ pdnsKey ];
1132+ }
10531133 }
10541134 if ($ providerDisplay === 'ClouDNS ' ) {
10551135 $ recordData ['cloudns_auth_id ' ] = $ cloudnsAuthId ;
@@ -1279,6 +1359,26 @@ public function zoneUpdateRecord(Request $request, Response $response)
12791359 }
12801360 if ($ powerdnsip !== '127.0.0.1 ' && isValidIP ($ powerdnsip )) {
12811361 $ deleteData ['powerdnsip ' ] = $ powerdnsip ;
1362+ $ deleteData ['pdns_master_ip ' ] = $ powerdnsip ;
1363+ }
1364+ // NS2–NS13 (slaves)
1365+ for ($ i = 2 ; $ i <= 13 ; $ i ++) {
1366+ $ suffix = '_NS ' . $ i ;
1367+
1368+ $ apiKeyKey = 'API_KEY ' . $ suffix ;
1369+ if (!empty ($ credentials [$ apiKeyKey ])) {
1370+ $ deleteData ['apikey_ns ' . $ i ] = $ credentials [$ apiKeyKey ];
1371+ }
1372+
1373+ $ bindKey = 'BIND_IP ' . $ suffix ;
1374+ if (!empty ($ credentials [$ bindKey ]) && isValidIP ($ credentials [$ bindKey ])) {
1375+ $ deleteData ['bindip_ns ' . $ i ] = $ credentials [$ bindKey ];
1376+ }
1377+
1378+ $ pdnsKey = 'POWERDNS_IP ' . $ suffix ;
1379+ if (!empty ($ credentials [$ pdnsKey ]) && isValidIP ($ credentials [$ pdnsKey ])) {
1380+ $ deleteData ['powerdnsip_ns ' . $ i ] = $ credentials [$ pdnsKey ];
1381+ }
12821382 }
12831383 if ($ providerDisplay === 'ClouDNS ' ) {
12841384 $ deleteData ['cloudns_auth_id ' ] = $ cloudnsAuthId ;
@@ -1310,6 +1410,26 @@ public function zoneUpdateRecord(Request $request, Response $response)
13101410 }
13111411 if ($ powerdnsip !== '127.0.0.1 ' && isValidIP ($ powerdnsip )) {
13121412 $ updateData ['powerdnsip ' ] = $ powerdnsip ;
1413+ $ updateData ['pdns_master_ip ' ] = $ powerdnsip ;
1414+ }
1415+ // NS2–NS13 (slaves)
1416+ for ($ i = 2 ; $ i <= 13 ; $ i ++) {
1417+ $ suffix = '_NS ' . $ i ;
1418+
1419+ $ apiKeyKey = 'API_KEY ' . $ suffix ;
1420+ if (!empty ($ credentials [$ apiKeyKey ])) {
1421+ $ updateData ['apikey_ns ' . $ i ] = $ credentials [$ apiKeyKey ];
1422+ }
1423+
1424+ $ bindKey = 'BIND_IP ' . $ suffix ;
1425+ if (!empty ($ credentials [$ bindKey ]) && isValidIP ($ credentials [$ bindKey ])) {
1426+ $ updateData ['bindip_ns ' . $ i ] = $ credentials [$ bindKey ];
1427+ }
1428+
1429+ $ pdnsKey = 'POWERDNS_IP ' . $ suffix ;
1430+ if (!empty ($ credentials [$ pdnsKey ]) && isValidIP ($ credentials [$ pdnsKey ])) {
1431+ $ updateData ['powerdnsip_ns ' . $ i ] = $ credentials [$ pdnsKey ];
1432+ }
13131433 }
13141434 if ($ providerDisplay === 'ClouDNS ' ) {
13151435 $ updateData ['cloudns_auth_id ' ] = $ cloudnsAuthId ;
@@ -1439,6 +1559,26 @@ public function deleteZone(Request $request, Response $response, $args)
14391559 }
14401560 if ($ powerdnsip !== '127.0.0.1 ' && isValidIP ($ powerdnsip )) {
14411561 $ config ['powerdnsip ' ] = $ powerdnsip ;
1562+ $ config ['pdns_master_ip ' ] = $ powerdnsip ;
1563+ }
1564+ // NS2–NS13 (slaves)
1565+ for ($ i = 2 ; $ i <= 13 ; $ i ++) {
1566+ $ suffix = '_NS ' . $ i ;
1567+
1568+ $ apiKeyKey = 'API_KEY ' . $ suffix ;
1569+ if (!empty ($ credentials [$ apiKeyKey ])) {
1570+ $ config ['apikey_ns ' . $ i ] = $ credentials [$ apiKeyKey ];
1571+ }
1572+
1573+ $ bindKey = 'BIND_IP ' . $ suffix ;
1574+ if (!empty ($ credentials [$ bindKey ]) && isValidIP ($ credentials [$ bindKey ])) {
1575+ $ config ['bindip_ns ' . $ i ] = $ credentials [$ bindKey ];
1576+ }
1577+
1578+ $ pdnsKey = 'POWERDNS_IP ' . $ suffix ;
1579+ if (!empty ($ credentials [$ pdnsKey ]) && isValidIP ($ credentials [$ pdnsKey ])) {
1580+ $ config ['powerdnsip_ns ' . $ i ] = $ credentials [$ pdnsKey ];
1581+ }
14421582 }
14431583 if ($ providerDisplay === 'ClouDNS ' ) {
14441584 $ config ['cloudns_auth_id ' ] = $ cloudnsAuthId ;
0 commit comments