<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Trying to do the following in dnsdist and failing as I don’t think DNSAnswer supports the spoof option. Is there a way to implement the following login in dnsdist Lua script?</div><div class=""><br class=""></div><div class=""><div class=""><font face="Courier New" class="">function nxdomain(dq)</font></div><div class=""><font face="Courier New" class="">  local qname = dq.qname</font></div><div class=""><font face="Courier New" class="">  print("Query: "..qname:toString())</font></div><div class=""><font face="Courier New" class="">  if (dq.qtype == DNSQType.NAPTR) then</font></div><div class=""><font face="Courier New" class="">    if (qname:countLabels() == 12) then</font></div><div class=""><font face="Courier New" class="">      qname:chopOff()</font></div><div class=""><font face="Courier New" class="">    end</font></div><div class=""><font face="Courier New" class="">    if (qname:countLabels() > 8) then</font></div><div class=""><font face="Courier New" class="">      qname:chopOff()</font></div><div class=""><font face="Courier New" class="">      local reply = "*."..qname:toString()</font></div><div class=""><font face="Courier New" class="">      print("Return: "..reply)</font></div><div class=""><font face="Courier New" class="">    else</font></div><div class=""><font face="Courier New" class="">      return DNSAction.None, ""</font></div><div class=""><font face="Courier New" class="">    end</font></div><div class=""><font face="Courier New" class="">  end</font></div><div class=""><font face="Courier New" class="">end</font></div><div class=""><font face="Courier New" class=""><br class=""></font></div><div class=""><font face="Courier New" class="">addResponseAction(RCodeRule(DNSRCode.NXDOMAIN), LuaResponseAction(nxdomain))</font></div></div><div class=""><br class=""></div><div class="">I’ve also tried:</div><div class=""><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><font face="Courier New" class="">      return SpoofCNAMEAction(reply)</font></div></div><div class=""><br class=""></div><div class="">But that didn’t work either. It seems that LueResponseAction is limited as to what the reply can be. What I’m trying to do is intercept NXDOMAIN replies and return a different value from a ‘parent’ record, hence the chopOff() and then using spoofing to return a valid reply instead of the original NXDOMAIN.</div></body></html>