DNS Headers
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RCODE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QDCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ANCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| NSCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ARCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
#;; id = 27825
#;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 0
#;; ra = 0 ad = 0 cd = 0 rcode = NOERROR
#;; qdcount = 1 ancount = 0 nscount = 7 arcount = 10
print "query identification number = " . $packet->header->id . "\n";
print "query response = " . $packet->header->qr . "\n";
print "opcode (the purpose of the query) = " . $packet->header->opcode . "\n";
print "authoritative answer = " . $packet->header->aa . "\n";
print "truncated packet = " . $packet->header->tc . "\n";
print "recursion desired = " . $packet->header->rd . "\n";
print "recursion allowed = " . $packet->header->ra . "\n";
print "checking disabled = " . $packet->header->cd . "\n";
print "recursion available = " . $packet->header->ra . "\n";
print "ad (DNSSEC) = " . $packet->header->ad . "\n";
print "response code = " . $packet->header->rcode . "\n";
print "number of records in the question section = " . $packet->header->qdcount . "\n";
print "number of records in the answer section = " . $packet->header->ancount . "\n";
print "number of records in the authority section = " . $packet->header->nscount . "\n";
print "number of records in the additional section = " . $packet->header->arcount . "\n";