setChildClass ('qcEvents_Server_DNS', true); $Listener->multicastJoinGroup ('224.0.0.251'); $Listener->bind (5353); $Listener->addChildHook ('dnsQueryReceived', function (qcEvents_Stream_DNS $Stream, qcEvents_Stream_DNS_Message $Query) { $Response = $Query->createResponse (); if ($Query->getQuestions ()[0]->Label != 'test-mdns.local.') return $Stream->dnsQueryDiscard ($Query); $Response->addAnswer ($Answer = new qcEvents_Stream_DNS_Record_A ('test-mdns.local.', 192342)); $Answer->setAddress ('127.0.0.1'); $Stream->dnsQueryReply ($Response); }); $Base->loop (); ?>