I think the DNS response needs a question and answer section.
I moddified / added
_dnsHeader->QDCount = _dnsHeader->QDCount; //was = 0
_dnsHeader->RA = 1; //added
at the begining of DNSServer::replyWithIP() .
RA=1 sets the recursion available bit in the header. QDCount sets the count of questions in the header.
current dig
C:\tmp\BIND9.10.2-P1.x64>dig test.com
;; Warning: Message parser reports malformed message packet.
; <<>> DiG 9.10.2-P1 <<>> test.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52866
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: Message has 3 extra bytes at end
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;test.com. IN A
;; Query time: 193 msec
;; SERVER: 192.168.4.1#53(192.168.4.1)
;; WHEN: Fri Jun 26 06:58:12 Eastern Daylight Time 2015
;; MSG SIZE rcvd: 51
DNS packet overview
http://www.ccs.neu.edu/home/amislove/te ... primer.pdf