diff options
-rwxr-xr-x | mdns-resolver | 7 |
1 files 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+'.' |