it should convert it as 0377777706676F6F676C6503636F6D00
0377777706676F6F676C6503636F6D00 is the hex dump representation of the name part of the assembled DNS packet:
0020 0a 02 80 22 00 35 00 28 96 13 f4 3b 01 00 00 01 ...".5.( ...; +.... 0030 00 00 00 00 00 00 03 77 77 77 06 67 6f 6f 67 6c .......w ww.g +oogl 0040 65 03 63 6f 6d 00 00 01 00 01 e.com... ..
The above dump lines correspond to the the plaintext tree parts shown in the middle frame of the wireshark window:
Answer RRs: 0 Additional RRs: 0 V Queries V www.google.com: type A, class IN Name: www.google.com Type: A (Host address) Class: IN (0x0001)
So, as you see, the name is encoded in that packet as you require, as it is sent to the DNS server. Encoding that beforehand doesn't make sense. I guess you are having an XY problem. What are you trying to do, with what results?
--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}
In reply to Re: How to convert the domain name format data into hexadecimal format?
by shmem
in thread How to convert the domain name format data into hexadecimal format?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |