final class EventDnsBase (View source)

EventDnsBase.

Represents Libevent's DNS base structure. Used to resolve DNS asyncronously, parse configuration files like resolv.conf etc.

Constants

OPTION_SEARCH

OPTION_NAMESERVERS

OPTION_MISC

OPTION_HOSTSFILE

OPTIONS_ALL

Methods

__construct(EventBase $base, bool $initialize)

__construct.

bool
addNameserverIp(string $ip)

addNameserverIp.

void
addSearch(string $domain)

addSearch.

void
clearSearch()

clearSearch.

int
countNameservers()

countNameservers.

bool
loadHosts(string $hosts)

loadHosts.

bool
parseResolvConf(int $flags, string $filename)

parseResolvConf.

bool
setOption(string $option, string $value)

setOption.

void
setSearchNdots(int $ndots)

setSearchNdots.

Details

__construct(EventBase $base, bool $initialize)

__construct.

Constructs EventDnsBase object.

Parameters

EventBase $base
bool $initialize

See also

https://secure.php.net/manual/en/eventdnsbase.construct.php

bool addNameserverIp(string $ip)

addNameserverIp.

Adds a nameserver to the DNS base.

Parameters

string $ip

Return Value

bool

See also

https://secure.php.net/manual/en/eventdnsbase.addnameserverip.php

void addSearch(string $domain)

addSearch.

Adds a domain to the list of search domains.

Parameters

string $domain

Return Value

void

See also

https://secure.php.net/manual/en/eventdnsbase.addsearch.php

void clearSearch()

clearSearch.

Removes all current search suffixes.

int countNameservers()

countNameservers.

Gets the number of configured nameservers.

bool loadHosts(string $hosts)

loadHosts.

Loads a hosts file (in the same format as /etc/hosts) from hosts file.

Parameters

string $hosts

Return Value

bool

See also

https://secure.php.net/manual/en/eventdnsbase.loadhosts.php

bool parseResolvConf(int $flags, string $filename)

parseResolvConf.

Scans the resolv.conf-formatted file.

Parameters

int $flags
string $filename

Return Value

bool

See also

https://secure.php.net/manual/en/eventdnsbase.parseresolvconf.php

bool setOption(string $option, string $value)

setOption.

Set the value of a configuration option.

Parameters

string $option
string $value

Return Value

bool

See also

https://secure.php.net/manual/en/eventdnsbase.setoption.php

void setSearchNdots(int $ndots)

setSearchNdots.

Set the 'ndots' parameter for searches.

Parameters

int $ndots

Return Value

void

See also

https://secure.php.net/manual/en/eventdnsbase.setsearchndots.php