in reply to Re^3: Disassembling DNS Packet
in thread Disassembling DNS Packet

unpack "v"? Are you sure? Little-endian? For a network protocol?

This is where I need some help.

my $transid = unpack('n', substr($payload,0,2));

My script returns "Theres a transid 29754" and dig returns 43785 in a separate terminal.

Replies are listed 'Best First'.
Re^5: Disassembling DNS Packet
by ikegami (Patriarch) on May 13, 2010 at 20:36 UTC

    There's no relation between 29754 (0x743A) and 43785 (0xAB09). You're trying to unpack the wrong bytes, your expectations are wrong, or both.