File: localdns.rb

package info (click to toggle)
dnsruby 1.61.5-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,520 kB
  • sloc: ruby: 17,811; makefile: 3
file content (29 lines) | stat: -rwxr-xr-x 641 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env ruby

require_relative 'spec_helper'

require_relative "test_dnsserver"

class SimpleTCPPipeliningUDPServer < Async::DNS::Server
  PORT     = 53938
  IP   = '127.0.0.1'

  def initialize(**options)
    super(options)

    @handlers << TcpPipelineHandler.new(self, IP, PORT)
    @handlers << Async::DNS::UDPServerHandler.new(self, IP, PORT)

  end

  def process(name, resource_class, transaction)
    @logger.debug "name: #{name}"
    transaction.respond!("93.184.216.34", { resource_class: ::Resolv::DNS::Resource::IN::A })
  end

end


if __FILE__ == $0
  RubyDNS::run_server(server_class: SimpleTCPPipeliningUDPServer)
end