Skip to content

Instantly share code, notes, and snippets.

@RonGee
RonGee / DNSQuery.php
Last active June 25, 2024 04:49 — forked from Ronmi/DNSQuery.php
Pure php code to query DNS record (altered slightly to correctly return TXT records, may break other usage since I don't pretend to understand it)
<?php
/**
* Usage:
* $obj = new DNSQuery('www.google.com', '8.8.8.8', 1, 'A', 'IN');
* if ($obj->isSuccess()) var_dump(DNSQuery::parse($obj->response));
*/
class DNSQuery
{
private $name;