This project is read-only.

How do I ask a mDNS question in BuildDnsPacket()?

Jul 17, 2014 at 6:48 PM
I'm looking to send out a mDNS style packet on a UDP port. Is there a way to build the DNS packet so that it will be able to add a question?

For example in C++ you would do this:
q_name = new QuestionName("_http._tcp.local"),
        q_type = QuerryConstants.Question.QuestionType.PTR,
        q_class = QuerryConstants.Question.QuestionClass.IN
DnsQuery query = new DnsQuery();
    query.Header.idL = 0;

    var querryByte = query.ToByteArray();
    UdpClient client = new UdpClient(AddressFamily.InterNetwork);

    IPEndPoint ipend = new IPEndPoint(IPAddress.Parse(MulticastIp), 5353);             
    client.Send(querryByte, querryByte.Length, ipend);
Is there a way to add the "question" part to the DNSlayer in pcapdotnet? Or possibly just send out a mdns in general?

Jul 19, 2014 at 6:38 AM
It seems you've asked and answered this question in StackOverflow:

Here is a screenshot: