SoluteDNS allows developers to add own scripted points where zones need to be edited. A developer can call three functions to add, edit or delete a record from a zone.
Add record:
Code: Select all
$domain = "example.com";
$newrecord = array(
"name" => "example.com",
"type" => "A",
"content" => "192.168.2.1",
"prio" => "0",
"ttl" => "3600",
);
$api_call = solutedns_api_add($domain,$newrecord);
Code: Select all
$domain = "example.com";
$newrecord = array(
"name" => "example.com",
"type" => "MX",
"content" => "127.0.0.5",
"prio" => "0",
"ttl" => "3600",
);
$current = array(
"name" => "example.com",
"type" => "A",
"content" => "192.168.2.1",
);
$api_call = solutedns_api_edit($domain,$current,$newrecord);
Code: Select all
$domain = "example.com";
$delete = array(
"name" => "example.com",
"type" => "A",
"content" => "192.168.2.1",
);
$api_call = solutedns_api_delete($domain,$delete);
Code: Select all
$domain = "example.com";
$api_call = solutedns_api_dnsseckeys($domain);
Code: Select all
$domain = "example.com";
$api_call = solutedns_api_getzone($domain);
When calling the api function the function will return an answer in a array consisting the status: success or error, and a message description.
Success message:
Code: Select all
Array ( [status] => success [description] => Record has been added to: test.com )
Code: Select all
Array ( [status] => error [description] => Record has not been found. Unable to delete! )
Review returned results
To review the returned results of the API call you can use this code:
Code: Select all
echo '<pre>';
var_dump($api_call);
echo'</pre>';