Class: BetterCap::Network::Servers::DnsWrapper
- Inherits:
-
RubyDNS::RuleBasedServer
- Object
- RubyDNS::RuleBasedServer
- BetterCap::Network::Servers::DnsWrapper
- Defined in:
- lib/bettercap/network/servers/dnsd.rb
Overview
Class to wrap RubyDNS::RuleBasedServer and add some utility methods.
Constant Summary collapse
- @@instance =
we need this in order to add rules at runtime.
nil
Instance Attribute Summary collapse
-
#rules ⇒ Object
List of redirection rules.
Class Method Summary collapse
-
.get ⇒ Object
Return the active instance of this object.
Instance Method Summary collapse
-
#initialize(options = {}, &block) ⇒ DnsWrapper
constructor
Instantiate a server with a block.
-
#process(name, resource_class, transaction) ⇒ Object
Give a name and a record type, try to match a rule and use it for processing the given arguments.
Constructor Details
#initialize(options = {}, &block) ⇒ DnsWrapper
Instantiate a server with a block.
31 32 33 34 35 |
# File 'lib/bettercap/network/servers/dnsd.rb', line 31 def initialize( = {}, &block) super(,&block) @rules = [] @@instance = self end |
Instance Attribute Details
#rules ⇒ Object
List of redirection rules.
21 22 23 |
# File 'lib/bettercap/network/servers/dnsd.rb', line 21 def rules @rules end |
Class Method Details
.get ⇒ Object
Return the active instance of this object.
26 27 28 |
# File 'lib/bettercap/network/servers/dnsd.rb', line 26 def self.get @@instance end |
Instance Method Details
#process(name, resource_class, transaction) ⇒ Object
Give a name and a record type, try to match a rule and use it for processing the given arguments.
37 38 39 40 |
# File 'lib/bettercap/network/servers/dnsd.rb', line 37 def process(name, resource_class, transaction) Logger.debug "[#{'DNS'.green}] Received #{resource_class.name} request for #{name} ..." super end |