Class: DNSResolver
- Inherits:
-
AsyncResolverWithCache
- Object
- AsyncResolverWithCache
- DNSResolver
- Defined in:
- lib/DNSResolver.rb
Instance Attribute Summary
Attributes inherited from AsyncResolverWithCache
Instance Method Summary collapse
- #hostName(ip) ⇒ Object
-
#initialize ⇒ DNSResolver
constructor
A new instance of DNSResolver.
- #newRecord ⇒ Object
Methods inherited from AsyncResolverWithCache
#cacheSize, #expireInMinutes, #flushQueue, #queueSize, #resolve, #stopAndSave
Constructor Details
#initialize ⇒ DNSResolver
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 |
#newRecord ⇒ Object
44 45 46 |
# File 'lib/DNSResolver.rb', line 44 def newRecord DNSRecord.new end |