foreach ($results['dnssec'] as $key => $value) { $configdata .= "key " . $value['key-name'] . " {\n"; $configdata .= "\talgorithm " . $value['algorithm'] . ";\n"; $configdata .= "\tsecret " . $value['key'] . ";\n"; $configdata .= "}\n"; } } //echo "<pre>"; print_r( $results['dns'] ); echo "</pre>"; // configure the dns zones if any if (count($results['dns']) !== 0) { $configdata .= "\n#### DNS Zone Definitions ####\n"; foreach ($results['dns'] as $key => $value) { // this is a fix for domains that do not have reverse lookup zones setup $revaddr = @dns_get_record($value['zone'], 'DNS_PTR'); if (empty($revaddr) || count($revaddr) === 0) { $revaddr = $misc->GenRevAddr(@gethostbyname($value['zone'])); } $reversed = $revaddr[0]['host']; // process the forward dns zone w/ or w/o the dnssec keys if ($value['dnssec-enabled'] === "true") { $configdata .= "zone " . $value['zone'] . " {\n"; $configdata .= "\tprimary " . $value['type'] . ";\n"; $configdata .= "\tkey " . $value['dnssec-key'] . ";\n"; $configdata .= "}\n"; } else { $configdata .= "zone " . $value['zone'] . " {\n"; $configdata .= "\tprimary " . $value['type'] . ";\n"; $configdata .= "}\n"; } // and for the reversed dns zone w/ or w/o the dnssec keys if ($value['dnssec-enabled'] === "true") {