in reply to How to create a DNS message in perl?
$QNAME = unpack("H*", "www.google.com")
For more read:
perldoc -f unpack and perldoc -f pack