Documentation

Rfc1035StubDnsResolver
in package
implements DnsResolver uses ForbidCloning, ForbidSerialization

FinalYes

Table of Contents

Interfaces

DnsResolver

Constants

CACHE_PREFIX  = "amphp.dns."
CONFIG_FAILED  = 2
CONFIG_LOADED  = 1
CONFIG_NOT_LOADED  = 0

Properties

$blockingFallbackResolver  : BlockingFallbackDnsResolver
$cache  : Cache<string|int, array<int, array{string, int}>>
$config  : DnsConfig|null
$configLoader  : DnsConfigLoader
$configStatus  : int
$gcCallbackId  : string
$nextNameserver  : int
$pendingConfig  : Future|null
$pendingQueries  : array<string|int, Future>
$pendingSockets  : array<string|int, Future>
$questionFactory  : QuestionFactory
$sockets  : array<string|int, Socket>

Methods

__construct()  : mixed
__destruct()  : mixed
__serialize()  : never
__unserialize()  : never
query()  : array<int, DnsRecord>
Query specific DNS records.
reloadConfig()  : DnsConfig
Reloads the configuration in the background.
resolve()  : array<int, DnsRecord>
Resolves a hostname name to an IP address [hostname as defined by RFC 3986].
__clone()  : mixed
assertAcceptableResponse()  : void
createQuestion()  : Question
getCacheKey()  : string
getSocket()  : Socket
loadConfigIfNotLoaded()  : void
normalizeName()  : string
queryHosts()  : array<int, DnsRecord>
searchForAliasRecord()  : string|null
selectNameservers()  : array<string|int, mixed>
shouldRetry()  : bool

Constants

Properties

Methods

__unserialize()

public final __unserialize(array<string|int, mixed> $data) : never
Parameters
$data : array<string|int, mixed>
Return values
never

query()

Query specific DNS records.

public query(string $name, int $type[, Cancellation|null $cancellation = null ]) : array<int, DnsRecord>

Upon success this method returns an array of Record objects. If no records of the given type are found, a DnsException is thrown.

Parameters
$name : string

Record to question, A, AAAA and PTR queries are automatically normalized.

$type : int

Use constants of Amp\Dns\Record.

$cancellation : Cancellation|null = null
Return values
array<int, DnsRecord>

resolve()

Resolves a hostname name to an IP address [hostname as defined by RFC 3986].

public resolve(string $name[, int|null $typeRestriction = null ][, Cancellation|null $cancellation = null ]) : array<int, DnsRecord>

Upon success this method returns an array of Record objects. If the domain cannot be resolved, a DnsException is thrown.

A null $ttl value indicates the DNS name was resolved from the cache or the local hosts file.

Parameters
$name : string

The hostname to resolve.

$typeRestriction : int|null = null

Optional type restriction to Record::A or Record::AAAA, otherwise null.

$cancellation : Cancellation|null = null
Return values
array<int, DnsRecord>

getCacheKey()

private getCacheKey(string $name, int $type) : string
Parameters
$name : string
$type : int
Return values
string

getSocket()

private getSocket(string $uri) : Socket
Parameters
$uri : string
Return values
Socket

normalizeName()

private normalizeName(string $name, int $type) : string
Parameters
$name : string
$type : int
Return values
string

queryHosts()

private queryHosts(string $name[, int|null $typeRestriction = null ]) : array<int, DnsRecord>
Parameters
$name : string
$typeRestriction : int|null = null
Return values
array<int, DnsRecord>

selectNameservers()

private selectNameservers() : array<string|int, mixed>
Return values
array<string|int, mixed>

shouldRetry()

private shouldRetry(int|string $code) : bool
Parameters
$code : int|string
Return values
bool

        
On this page

Search results