10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/meltdown/dns_server.rb', line 10
def run
$stdout.sync = true
$stderr.sync = true
RubyDNS::run_server(:listen => [[:udp, "0.0.0.0", 20560]]) do
match(/.*\.dev$/, IN::A) do |match, transaction|
logger.info "DNS match A : #{transaction.inspect}"
transaction.respond!("127.0.0.1")
end
match(/.*\.dev$/, IN::AAAA) do |match, transaction|
logger.info "DNS match AAAA : #{transaction.inspect}"
transaction.respond!("::1")
end
match("1.0.0.127.in-addr.arpa", IN::PTR) do |transaction|
logger.info "DNS match PTR : #{transaction.inspect}"
transaction.respond!(Name.create("default.dev."))
end
end
end
|