lib/resolve/hostname.rb in resolve-hostname-0.0.2 vs lib/resolve/hostname.rb in resolve-hostname-0.0.3
- old
+ new
@@ -78,9 +78,18 @@
end
def resolve(name)
secondary = nil
+ is_address = false
+ begin
+ IPAddr.new(name)
+ is_address = true
+ rescue IPAddr::InvalidAddressError
+ # ignore
+ end
+ return name if is_address
+
if @system_resolver_enabled
addr = resolve_builtin(name)
if addr
return addr if primary_version_address?(addr)
secondary = addr