Fixed bugs and added missing functionality in packing code

Also, it now returns valid responses for root DNS servers!

$ host f.root-servers.net localhost
Using domain server:
Name: localhost
Address: ::1#53
Aliases:

f.root-servers.net has address 192.5.5.241
f.root-servers.net has IPv6 address 2001:500:2f::f