Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle locally-defined hostnames, without full DNS info

  • Loading branch information...
commit 271aee66d4621ffa43983cb6c5712e6aca845bc3 1 parent aac460c
@purcell authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  bin/postfix-policy-whois
View
3  bin/postfix-policy-whois
@@ -34,7 +34,8 @@ require 'resolv'
def nameserver_for(domain)
Timeout::timeout(5) do
begin
- Resolv::DNS.new.getresource(domain, Resolv::DNS::Resource::IN::ANY).name.to_s
+ record = Resolv::DNS.new.getresource(domain, Resolv::DNS::Resource::IN::ANY)
+ record.name.to_s if record.respond_to?(:name)
rescue Resolv::ResolvError
nil
end
Please sign in to comment.
Something went wrong with that request. Please try again.