Class: DNSResolver

Inherits:
AsyncResolverWithCache show all
Defined in:
lib/DNSResolver.rb

Instance Attribute Summary

Attributes inherited from AsyncResolverWithCache

#enabled

Instance Method Summary collapse

Methods inherited from AsyncResolverWithCache

#cacheSize, #expireInMinutes, #flushQueue, #queueSize, #resolve, #stopAndSave

Constructor Details

#initializeDNSResolver

Returns a new instance of DNSResolver.



39
40
41
42
# File 'lib/DNSResolver.rb', line 39

def initialize
  super('DNSCache', $globals.getSetting('DNSTimeout') * 60 * 60 * 24, 5)
  @enabled = $globals.getSetting('DNSResolver')
end

Instance Method Details

#hostName(ip) ⇒ Object



48
49
50
# File 'lib/DNSResolver.rb', line 48

def hostName(ip)
  (rec = resolve(ip)) ? rec.host : ip
end

#newRecordObject



44
45
46
# File 'lib/DNSResolver.rb', line 44

def newRecord
  DNSRecord.new
end