diff --git a/quovadis/quovadis.php b/quovadis/quovadis.php index b92edfe3d29b4399a40ca170c1a25e83cc3f1176..dab64a89739c24843da6794fb38e5b2369509704 100644 --- a/quovadis/quovadis.php +++ b/quovadis/quovadis.php @@ -54,7 +54,7 @@ function get_rfc2136_txt($config, $name) { } catch(Net_DNS2_Exception $e) { - echo "::query() failed: ", $e->getMessage(), "\n"; + #echo "::query() failed: ", $e->getMessage(), "\n"; return ""; } @@ -63,7 +63,9 @@ function get_rfc2136_txt($config, $name) { // foreach($result->answer as $txtrr) { - return $txtrr; + $answer = $txtrr->asArray(); + $txt = trim(end($answer),'"'); + return $txt; } // @@ -232,7 +234,7 @@ function delete_rfc2136_txt($config, $name) { } catch(Net_DNS2_Exception $e) { - echo "::update() for deleteAny failed: ", $e->getMessage(), "\n"; + #echo "::update() for deleteAny failed: ", $e->getMessage(), "\n"; } return ""; @@ -252,6 +254,8 @@ function update_rfc2136_txt($config, $name, $txt) { // $txtrr = Net_DNS2_RR::fromString($name . "." . $config['QV_DOMAIN'] . ' TXT "'. $txt . '"'); + $txtrr->ttl=60; + // // add the record // @@ -270,7 +274,7 @@ function update_rfc2136_txt($config, $name, $txt) { } catch(Net_DNS2_Exception $e) { - echo "::update() failed: ", $e->getMessage(), "\n"; + #echo "::update() failed: ", $e->getMessage(), "\n"; } return "";