good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
How to create a DNS message in perl?by sanjay nayak (Sexton) |
on Jul 29, 2008 at 07:55 UTC ( [id://700743]=perlquestion: print w/replies, xml ) | Need Help?? |
sanjay nayak has asked for the wisdom of the Perl Monks concerning the following question:
I am writing a code as follows
Here the problem is that Suppose i am assigning the value $ID=1. How can can i convert it into the hexa value of 2 octets which is '0001' and so for other values with their respective octets. The $QNAME = "www.google.com". How can i convert it into the hexa value '0377777706676F6F676C6503636F6D00'. So that Wire shark will decoded it properly without showing malformed packet. The problem is that if i am sending the $QNAME value diretly (That means without converting into the hexa format). The wireshark decoded it as '7777772e676F6F676C652e636F6D'.Which shows it as a malformed packet. Plz suggest me a suitable code. So that i can send a DNS request properly. Regd's Sanjay
Back to
Seekers of Perl Wisdom
|
|