diff --git a/src/Endpoints/DNS.php b/src/Endpoints/DNS.php index a8aad754..24aaedfc 100644 --- a/src/Endpoints/DNS.php +++ b/src/Endpoints/DNS.php @@ -108,6 +108,15 @@ public function listRecords( return (object)['result' => $body->result, 'result_info' => $body->result_info]; } + + public function getRecordID(string $zoneID, string $type = '', string $name = ''): string + { + $records = $this->listRecords($zoneID, $type, $name); + if (count($records->result) < 1) { + throw new EndpointException('Could not find records with specified name.'); + } + return $records->result[0]->id; + } public function getRecordDetails(string $zoneID, string $recordID): \stdClass {