Skip to content

Commit

Permalink
Handle locally-defined hostnames, without full DNS info
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Nov 6, 2012
1 parent aac460c commit 271aee6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/postfix-policy-whois
Expand Up @@ -34,7 +34,8 @@ require 'resolv'
def nameserver_for(domain) def nameserver_for(domain)
Timeout::timeout(5) do Timeout::timeout(5) do
begin 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 rescue Resolv::ResolvError
nil nil
end end
Expand Down

0 comments on commit 271aee6

Please sign in to comment.