You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
295 B

class Dnsbl
PROVIDER = '.in.dnsbl.org'
@dns = Resolv::DNS.new
def self.include?(domain_name)
query(domain_name) != nil
end
def self.query(domain_name)
@dns.getresource(domain_name + PROVIDER, Resolv::DNS::Resource::IN::A)
rescue Resolv::ResolvError
nil
end
end