Method: Dnsruby::DNS#getaddress
- Defined in:
- lib/dnsruby/DNS.rb
#getaddress(name) ⇒ Object
Gets the first IP address of name from the DNS resolver
name can be a Dnsruby::Name or a String. Retrieved address will be a Dnsruby::IPv4 or a Dnsruby::IPv6
134 135 136 137 |
# File 'lib/dnsruby/DNS.rb', line 134 def getaddress(name) each_address(name) {|address| return address} raise ResolvError.new("DNS result has no information for #{name}") end |