This project is read-only.

Cannot extract IP address from DNS answer field

May 22, 2013 at 8:04 AM
Edited May 22, 2013 at 10: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();
May 31, 2013 at 8: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 1:19 PM
Thans Brickner for your help.