I was attempting to run this sample code I found on the website.

function dumpPacket(dq)
  local packet = dq:getContent()
  local overlay = newDNSPacketOverlay(packet)
  print(overlay.qname)
  print(overlay.qtype)
  print(overlay.qclass)
  local count = overlay:getRecordsCountInSection(DNSSection.Answer)
  print(count)
  for idx=0, count-1 do
    local record = overlay:getRecord(idx)
    print(record.name)
    print(record.type)
    print(record.class)
    print(record.ttl)
    print(record.place)
    print(record.contentLength)
    print(record.contentOffset)
  end
  return DNSAction.None
end

addAction(AllRule(), LuaAction(dumpPacket))




Essentially, it should print out details about the DNS answer it received.

On my machine, I get nothing.  It thinks count is always 0, when in fact
that is not true.  At this point I am trying to figure out why this code
does not work.
_______________________________________________
dnsdist mailing list
dnsdist@mailman.powerdns.com
https://mailman.powerdns.com/mailman/listinfo/dnsdist

Reply via email to