From ff56fd8a3fa79b23fc18c4aa2d7f2983d5230096 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 13 May 2012 03:34:42 +0200 Subject: Add NS records to ANY answer --- mdns-resolver | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mdns-resolver b/mdns-resolver index 608232d..762f8d9 100755 --- a/mdns-resolver +++ b/mdns-resolver @@ -10,7 +10,7 @@ $domain = 'mesh.ffhl' $port = 53 $ttl = 0 $ns = ['mesh.ffhl. 3600 IN NS paul.ffhl.'] -$soa = 'mesh.ffhl. 0 IN SOA paul.ffhl. freifunk\.luebeck.asta.uni-luebeck.de. 1 3600 180 600 60' +$soa = 'mesh.ffhl. 3600 IN SOA paul.ffhl. freifunk\.luebeck.asta.uni-luebeck.de. 1 3600 180 600 60' ### Config end ### @@ -87,8 +87,9 @@ while run do packet.question.each do |q| next unless q.qClass.to_i == Net::DNS::IN - if q.qName == $domain+'.' and (q.qType.to_i == Net::DNS::SOA or q.qType.to_i == Net::DNS::ANY) - packet.answer << soaRecord + if q.qName == $domain+'.' + packet.answer << soaRecord if q.qType.to_i == Net::DNS::SOA or q.qType.to_i == Net::DNS::ANY + $ns.each { |line| packet.answer << Net::DNS::RR::NS.new(line) } if q.qType.to_i == Net::DNS::NS or q.qType.to_i == Net::DNS::ANY else host, qdomain = q.qName.split('.', 2) next unless qdomain == $domain+'.' -- cgit v1.2.3