public function get_answer($question) { $answer = array(); $domain = trim($question[0]['qname'], '.'); $type = RecordTypeEnum::get_name($question[0]['qtype']); $records = $this->get_records_recursivly($domain, $type); foreach ($records as $record) { $answer[] = array('name' => $question[0]['qname'], 'class' => $question[0]['qclass'], 'ttl' => $record['ttl'], 'data' => array('type' => $question[0]['qtype'], 'value' => $record['answer'])); } return $answer; }
public function get_answer($question) { $answer = array(); $domain = trim($question[0]['qname'], '.'); $type = RecordTypeEnum::get_name($question[0]['qtype']); if (isset($this->dns_records[$domain]) && isset($this->dns_records[$domain][$type])) { if (is_array($this->dns_records[$domain][$type])) { foreach ($this->dns_records[$domain][$type] as $ip) { $answer[] = array('name' => $question[0]['qname'], 'class' => $question[0]['qclass'], 'ttl' => $this->DS_TTL, 'data' => array('type' => $question[0]['qtype'], 'value' => $ip)); } } } return $answer; }