new(config_info=nil) public

Creates a new DNS resolver.

config_info can be:


Uses /etc/resolv.conf.


Path to a file using /etc/resolv.conf’s format.


Must contain :nameserver, :search and :ndots keys.

:nameserver_port can be used to specify port number of nameserver address.

The value of :nameserver should be an address string or an array of address strings.

  • :nameserver => ‘’

  • :nameserver => [‘’, ‘’]

The value of :nameserver_port should be an array of pair of nameserver address and port number.

  • :nameserver_port => [[‘’, 53], [‘’, 53]]

Example: => [''],
                :search => [''],
                :ndots => 1)
Show source
Register or log in to add new notes.