DOH
in package
Wrapper class provided for compatibility with old software. Deprecated.
This class is deprecated. Consider using the new classes DOHCF or DOHGG
Table of Contents
Constants
- DEFPROVIDER = 'cloudflare'
- Default DOH provider. Valid values are "cloudflare" or "google".
Properties
- $status : int
Methods
- __construct() : mixed
- Build DOH object
- dns() : array<string, string>
- Execute a DNS query
- getStatus() : int
- Get the status for the last DNS query
- IPtoDNS() : string
- Convert IP address to a DNS representation
Constants
DEFPROVIDER
Default DOH provider. Valid values are "cloudflare" or "google".
public
mixed
DEFPROVIDER
= 'cloudflare'
You can edit this constant, but we recommend to use the global DOH_PROVIDER constant.
Properties
$status read-only
public
int
$status
Status code for the last query.
Methods
__construct()
Build DOH object
public
__construct(string $provider) : mixed
Parameters
- $provider : string
-
(optional) DNS over HTTPS provider to use
Tags
dns()
Execute a DNS query
public
dns(string $domain, string $type[, string $how = 'ipv4' ]) : array<string, string>
Inherited from DOHBase::dns()
Parameters
- $domain : string
-
Name to resolve
- $type : string
-
Record type to ask for
- $how : string = 'ipv4'
-
(optional) Indicates whether the connection will be via IPv4 or IPv6 (default is IPv4)
Tags
Return values
array<string, string> —Query result
getStatus()
Get the status for the last DNS query
public
getStatus() : int
Inhrerited from DOHBase::getStatus()
Return values
int —Status for the last query
IPtoDNS()
Convert IP address to a DNS representation
public
static IPtoDNS(string $ip) : string
Inhrerited from DOHBase::IPtoDNS()
Parameters
- $ip : string
-
IP address to convert
Return values
string —DNS name representing the IP