in reply to Re: How to convert the domain name format data into hexadecimal format?
in thread How to convert the domain name format data into hexadecimal format?

Hi

Thanks for your reply. But the problem is that.

Suppose i have declared My $domain_Name="www.google.com". When i am sending the above domain name with other

parameters of the dns message like type as A and class as IN. The wireshark decoded the above domain name as 7777772e676F6F676C652e636F6D.

So it shows it as malformed data. When the above domain name decoded as 0377777706676F6F676C6503636F6D00, at that time the wireshark recognise it fine. SO is there any function in perl to convert the above domain name into the above hexa value so that the wireshark recognise it well.

The problem in the hexa value is that the data "www" is decoded as 777777 then the "." is decoded as 2e(as 2e is the ascii value for "." char, here it should be 06 which is the ascii value for ACknowledge).

Actually what i want is that i have fetch the Domain name from a database where it is stored in the format www.google.com. Then i store that domain name in a variable called my $Domain_Name. When i will send that Domain Name along with other data in a dns message,at time the wireshark should decoded it as

0377777706676F6F676C6503636F6D00 instead of 7777772e676F6F676C652e636F6D. Plz suggest me is there any function for it in perl? So that before sending the

Domain_Name to the wireshrk it converts it into(For example) the 0377777706676F6F676C6503636F6D00 for the case of www.google.com

Regd's

Sanjay

  • Comment on Re^2: How to convert the domain name format data into hexadecimal format?

Replies are listed 'Best First'.
Re^3: How to convert the domain name format data into hexadecimal format?
by shmem (Chancellor) on Jul 22, 2008 at 08:28 UTC
    When i am sending the above domain name with other parameters of the dns message like type as A and class as IN. The wireshark decoded the above domain name as 7777772e676F6F676C652e636F6D.

    What other parameters? How are you sending the query? How do you assemble it? What perl function from what package with what parameters are you using? Why do you need wireshark at all to retrieve domain names from a database and sending DNS queries? Why do you need to convert strings into their hexadecimal representation, if you are storing the names as plain text in the database?

    If you showed some code, I could perhaps do more than just making educated guesses. Please see How do I post a question effectively?.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}