Module: Ronin::DNS::Proxy

Defined in:
lib/ronin/dns/proxy.rb,
lib/ronin/dns/proxy/rule.rb,
lib/ronin/dns/proxy/server.rb,
lib/ronin/dns/proxy/version.rb

Overview

Namespace for ronin-dns-proxy.

Defined Under Namespace

Classes: Rule, Server

Constant Summary collapse

VERSION =

ronin-dns-proxy version

'0.1.0'

Class Method Summary collapse

Class Method Details

.run(host, port, **kwargs) {|server| ... } ⇒ Object

Starts a new DNS proxy listening on the given host and port.

Examples:

require 'ronin/dns/proxy'

Ronin::DNS::Proxy.run('127.0.0.1', 2346) do |server|
  server.rule :A, 'example.com', '10.0.0.1'
  server.rule :AAAA, 'example.com', 'dead:beef::1'
end

Parameters:

  • host (String)

    The interface to listen on.

  • port (Integer)

    The local port to listen on.

  • kwargs (Hash{Symbol => Object})

    Additional keyword arguments for Ronin::DNS::Proxy::Server#initialize.

Options Hash (**kwargs):

  • :nameservers (Array<String>) — default: Ronin::Support::Network::DNS.nameservers

    The upstream DNS server(s) to pass queries to.

  • rules (Array<(Symbol, String, String), (Symbol, Regexp, String), (Symbol, Regexp, Proc)>)

    Optional rules to populate the server with.

Yields:

  • (server)

    If a block is given, it will be passed the newly created DNS proxy server object.

Yield Parameters:

  • server (Server)

    The newly created DNS proxy server.



62
63
64
65
# File 'lib/ronin/dns/proxy.rb', line 62

def self.run(host,port,**kwargs,&block)
  server = Server.new(host,port,**kwargs,&block)
  server.run
end