Class

Resolv::Hosts

Inheritance
< Object

DNS::Hosts is a hostname resolver that uses the system hosts file.

Constants

Name   Description
DefaultFileName = Win32::Resolv.get_hosts_path
DefaultFileName = '/etc/hosts'

Methods

Class

Visibility Signature
public new (filename = DefaultFileName)

Instance

Visibility Signature
public each_address (name, &proc)
public each_name (address, &proc)
public getaddress (name)
public getaddresses (name)
public getname (address)
public getnames (address)

Class Method Detail

new(filename = DefaultFileName)

Creates a new DNS::Hosts, using filename for its data source.

Instance Method Detail

each_address(name, &proc)

Iterates over all IP addresses for name retrieved from the hosts file.

each_name(address, &proc)

Iterates over all hostnames for address retrived from the hosts file.

getaddress(name)

Gets the IP address of name from the hosts file.

getaddresses(name)

Gets all IP addresses for name from the hosts file.

getname(address)

Gets the hostname of address from the hosts file.

getnames(address)

Gets all hostnames for address from the hosts file.