Cannot extract IP address from DNS answer field

May 22, 2013 at 7:04 AM
Edited May 22, 2013 at 9:22 AM
While trying to extract the IP address from answer of dns response it return PcapDotNet.Packets.Dns.DnsResourceDataIpV4. Can anyone tell me what should i do to get the IP address from answer field.

I used
DnsDatagram dns = udp.Dns;
dns.Answers[0].Data.ToString();
Coordinator
May 31, 2013 at 7:53 AM
DnsResourceDataIpV4 class has a Data proprty of type IpV4Address.
You might need to first down cast what you get to DnsResourceDataIpV4 in order to call the property.
May 31, 2013 at 12:19 PM
Thans Brickner for your help.