You're getting wishy-washy answers because you've asked a wishy-washy question.
Can some one tell how to print a DNS packet answer
First of all, by what means are you capturing the DNS packet? Or put differently, what are you starting with?
the answer part it has the domain name compressed
The answer to most requests ("A") is an IPv4 address, not a domain name. It's not compressed. It's stored as a 32-bit int in network byte order.
When doing a reverse lookup ("PTR"), you get a domain name. It's not stored as a single string, but it's not compressed either. It's stored as a number of NUL-terminated strings, one for each segment of the full domain name, plus an empty one.
RFC 1035: Domain Names - Implementation and Specification
In reply to Re: How to print Compressed data in DNS
by ikegami
in thread How to print Compressed data in DNS
by deewanagan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |