Coder Social home page Coder Social logo

Comments (24)

keepsimple1 avatar keepsimple1 commented on August 16, 2024 1

@anenankhu I've opened a PR to fix this issue. Could you please try that PR branch and see if it helps? Thanks.

from mdns-sd.

keepsimple1 avatar keepsimple1 commented on August 16, 2024

I have only one Windows machine, so I cannot replicate your exact test. I tried a Windows machine + a MacOS machine, running the service on Mac and the query on Windows, and also vice-versa. I cannot reproduce the problem, i.e. the query always worked.

Is it possible for you to debug in your setup? Either turn on Debug level logging in the service side, or print out some debugs in the query side to see if can find anything suspicious?

from mdns-sd.

indietyp avatar indietyp commented on August 16, 2024

it's also possible that this is a firewall issue.

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

I have only one Windows machine, so I cannot replicate your exact test. I tried a Windows machine + a MacOS machine, running the service on Mac and the query on Windows, and also vice-versa. I cannot reproduce the problem, i.e. the query always worked.

Is it possible for you to debug in your setup? Either turn on Debug level logging in the service side, or print out some debugs in the query side to see if can find anything suspicious?

So the setup is like this:
Laptop (queries a service) is a Win 11 machine
Desktop (registers a service) is a Win 10 machine

From laptop, I can resolve the registered service by using dns-sd.exe(I think it's a part of bonjour?) and by using astro_dnssd crate. But not using this crate.

I've copied query example to a new bin crate, and added log and simple_logger crates and enabled log::Level::Debug

That's the output I've getting:

2022-06-16T17:18:26.311Z DEBUG [mdns_sd] new socket bind to 0.0.0.0:5353
2022-06-16T17:18:26.312Z DEBUG [mdns_sd] created listening socket: Socket { raw: 320, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
2022-06-16T17:18:26.313Z DEBUG [mdns_sd] new socket bind to 0.0.0.0:5353
Received other event: SearchStarted("_test._tcp.local.")
2022-06-16T17:18:26.335Z DEBUG [mdns_sd] Sending multicast query for _test._tcp.local.
2022-06-16T17:18:26.336Z DEBUG [mdns_sd] Sending query to SockAddr { ss_family: 2, len: 16 }: 1 questions 0 answers 0 authorities 0 additional
2022-06-16T17:18:26.339Z DEBUG [mdns_sd] sent out 39 bytes on socket Socket { raw: 168, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
2022-06-16T17:18:26.340Z DEBUG [mdns_sd] received 39 bytes
2022-06-16T17:18:26.340Z DEBUG [mdns_sd] read_header: id 0, 1 questions 0 answers 0 authorities 0 additionals
2022-06-16T17:18:26.341Z DEBUG [mdns_sd] read_questions: 1
2022-06-16T17:18:26.341Z DEBUG [mdns_sd] read_others: 0
2022-06-16T17:18:26.341Z DEBUG [mdns_sd] question: DnsQuestion { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false } }
Received other event: SearchStarted("_test._tcp.local.")
2022-06-16T17:18:27.354Z DEBUG [mdns_sd] Sending multicast query for _test._tcp.local.
2022-06-16T17:18:27.355Z DEBUG [mdns_sd] Sending query to SockAddr { ss_family: 2, len: 16 }: 1 questions 0 answers 0 authorities 0 additional
2022-06-16T17:18:27.356Z DEBUG [mdns_sd] sent out 39 bytes on socket Socket { raw: 168, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
2022-06-16T17:18:27.356Z DEBUG [mdns_sd] received 39 bytes
2022-06-16T17:18:27.356Z DEBUG [mdns_sd] read_header: id 0, 1 questions 0 answers 0 authorities 0 additionals
2022-06-16T17:18:27.357Z DEBUG [mdns_sd] read_questions: 1
2022-06-16T17:18:27.357Z DEBUG [mdns_sd] read_others: 0
2022-06-16T17:18:27.357Z DEBUG [mdns_sd] question: DnsQuestion { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false } }
Received other event: SearchStarted("_test._tcp.local.")
2022-06-16T17:18:29.356Z DEBUG [mdns_sd] Sending multicast query for _test._tcp.local.
2022-06-16T17:18:29.357Z DEBUG [mdns_sd] Sending query to SockAddr { ss_family: 2, len: 16 }: 1 questions 0 answers 0 authorities 0 additional
2022-06-16T17:18:29.358Z DEBUG [mdns_sd] sent out 39 bytes on socket Socket { raw: 168, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
2022-06-16T17:18:29.359Z DEBUG [mdns_sd] received 39 bytes
2022-06-16T17:18:29.360Z DEBUG [mdns_sd] read_header: id 0, 1 questions 0 answers 0 authorities 0 additionals
2022-06-16T17:18:29.360Z DEBUG [mdns_sd] read_questions: 1
2022-06-16T17:18:29.361Z DEBUG [mdns_sd] read_others: 0
2022-06-16T17:18:29.362Z DEBUG [mdns_sd] question: DnsQuestion { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false } }

I've also tried to debug it using CLion but haven't had enough time to understand the inner workings of this package enough to understand what the problem is.

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

it's also possible that this is a firewall issue.

What should I look at? dns-sd.exe and another crate do not have this problem.

Edit: tried shutting Windows Defender down, didn't help.

from mdns-sd.

keepsimple1 avatar keepsimple1 commented on August 16, 2024

@anenankhu the query side log shows that it has not received any responses (i.e. answers). Is it possible to get logs of the registered service side?

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

@keepsimple1
First log is queried by astro_dnssd

❯ ./test.exe
tide::log Logger started
    level DEBUG
mdns_sd new socket bind to 0.0.0.0:5353
mdns_sd created listening socket: Socket { raw: 332, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
tide::server Server listening on http://0.0.0.0:8081
mdns_sd new socket bind to 0.0.0.0:5353
mdns_sd register service ServiceInfo { ty_domain: "_test._tcp.local.", fullname: "test._test._tcp.local.", server: "192.168.1.126.local."
, addresses: {192.168.1.126}, port: 8081, host_ttl: 120, other_ttl: 4500, priority: 0, weight: 0, properties: {"ip": "192.168.1.126"} }
mdns_sd broadcast service test._test._tcp.local.
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false }, ttl:
4500, created: 1655403497596, refresh: 1655407097596 }, alias: "test._test._tcp.local." }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsSrv { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 33, class: 1, unique: true }, ttl:
 120, created: 1655403497597, refresh: 1655403593597 }, priority: 0, weight: 0, host: "192.168.1.126.local.", port: 8081 }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsTxt { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 16, class: 1, unique: true }, ttl:
 4500, created: 1655403497597, refresh: 1655407097597 }, text: [16, 105, 112, 61, 49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 49, 50, 54] }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsAddress { record: DnsRecord { entry: DnsEntry { name: "192.168.1.126.local.", ty: 1, class: 1, unique: true }, ttl: 120,
 created: 1655403497598, refresh: 1655403593598 }, address: 192.168.1.126 }
mdns_sd Sending response to SockAddr { ss_family: 2, len: 16 }: 0 questions 4 answers 0 authorities 0 additional
mdns_sd writing text length 17
mdns_sd sent out 132 bytes on socket Socket { raw: 340, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
mdns_sd received 132 bytes
mdns_sd read_header: id 0, 0 questions 4 answers 0 authorities 0 additionals
mdns_sd read_questions: 0
mdns_sd read_others: 4
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, created: 16
55403497599, refresh: 1655407097599 }, alias: "test._test._tcp.local." }
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 33, class: 1, unique: true }, ttl: 120, created: 16
55403497600, refresh: 1655403593600 }, priority: 0, weight: 0, host: "192.168.1.126.local.", port: 8081 }
mdns_sd DnsTxt { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 16, class: 1, unique: true }, ttl: 4500, created: 1
655403497600, refresh: 1655407097600 }, text: [16, 105, 112, 61, 49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 49, 50, 54] }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "192.168.1.126.local.", ty: 1, class: 1, unique: true }, ttl: 120, created: 1655403
497600, refresh: 1655403593600 }, address: 192.168.1.126 }
mdns_sd handle_response: 4 answers 0 authorities 0 additionals
mdns_sd add_or_update record name: "_test._tcp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "test._test._tcp.local."
mdns_sd add_or_update record name: "test._test._tcp.local."
mdns_sd add_or_update record name: "192.168.1.126.local."
mdns_sd announce service: test._test._tcp.local.
mdns_sd broadcast service test._test._tcp.local.
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false }, ttl:
4500, created: 1655403498610, refresh: 1655407098610 }, alias: "test._test._tcp.local." }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsSrv { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 33, class: 1, unique: true }, ttl:
 120, created: 1655403498610, refresh: 1655403594610 }, priority: 0, weight: 0, host: "192.168.1.126.local.", port: 8081 }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsTxt { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 16, class: 1, unique: true }, ttl:
 4500, created: 1655403498611, refresh: 1655407098611 }, text: [16, 105, 112, 61, 49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 49, 50, 54] }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsAddress { record: DnsRecord { entry: DnsEntry { name: "192.168.1.126.local.", ty: 1, class: 1, unique: true }, ttl: 120,
 created: 1655403498611, refresh: 1655403594611 }, address: 192.168.1.126 }
mdns_sd Sending response to SockAddr { ss_family: 2, len: 16 }: 0 questions 4 answers 0 authorities 0 additional
mdns_sd writing text length 17
mdns_sd sent out 132 bytes on socket Socket { raw: 340, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
mdns_sd received 132 bytes
mdns_sd read_header: id 0, 0 questions 4 answers 0 authorities 0 additionals
mdns_sd read_questions: 0
mdns_sd read_others: 4
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, created: 16
55403498613, refresh: 1655407098613 }, alias: "test._test._tcp.local." }
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 33, class: 1, unique: true }, ttl: 120, created: 16
55403498613, refresh: 1655403594613 }, priority: 0, weight: 0, host: "192.168.1.126.local.", port: 8081 }
mdns_sd DnsTxt { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 16, class: 1, unique: true }, ttl: 4500, created: 1
655403498613, refresh: 1655407098613 }, text: [16, 105, 112, 61, 49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 49, 50, 54] }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "192.168.1.126.local.", ty: 1, class: 1, unique: true }, ttl: 120, created: 1655403
498614, refresh: 1655403594614 }, address: 192.168.1.126 }
mdns_sd handle_response: 4 answers 0 authorities 0 additionals
mdns_sd add_or_update record name: "_test._tcp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "test._test._tcp.local."
mdns_sd add_or_update record name: "test._test._tcp.local."
mdns_sd add_or_update record name: "192.168.1.126.local."
mdns_sd received 402 bytes
mdns_sd read_header: id 0, 0 questions 8 answers 0 authorities 4 additionals
mdns_sd read_questions: 0
mdns_sd read_others: 12
mdns_sd DnsTxt { record: DnsRecord { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 16, class: 1, unique: true }, ttl: 4500, cr
eated: 1655403506319, refresh: 1655407106319 }, text: [20, 98, 116, 61, 69, 48, 58, 66, 54, 58, 53, 53, 58, 57, 68, 58, 55, 57, 58, 57, 56] }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_services._dns-sd._udp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, crea
ted: 1655403506319, refresh: 1655407106319 }, alias: "_androidtvremote2._tcp.local." }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_androidtvremote2._tcp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, crea
ted: 1655403506320, refresh: 1655407106320 }, alias: "chromecast._androidtvremote2._tcp.local." }
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 33, class: 1, unique: true }, ttl: 120, cre
ated: 1655403506320, refresh: 1655403602320 }, priority: 0, weight: 0, host: "Android.local.", port: 6466 }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "102.1.168.192.in-addr.arpa.", ty: 12, class: 1, unique: true }, ttl: 120, created:
 1655403506320, refresh: 1655403602320 }, alias: "Android.local." }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "8.A.F.2.B.9.E.F.F.F.5.5.6.B.2.E.0.0.0.0.0.0.0.0.0.0.0.0.0.8.E.F.ip6.arpa.", ty: 12
, class: 1, unique: true }, ttl: 120, created: 1655403506321, refresh: 1655403602321 }, alias: "Android.local." }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "Android.local.", ty: 1, class: 1, unique: true }, ttl: 120, created: 1655403506321
, refresh: 1655403602321 }, address: 192.168.1.102 }
mdns_sd We don't support IPv6 TYPE_AAAA records
mdns_sd handle_response: 8 answers 0 authorities 4 additionals
mdns_sd add_or_update record name: "chromecast._androidtvremote2._tcp.local."
mdns_sd add_or_update record name: "_services._dns-sd._udp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "_androidtvremote2._tcp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "chromecast._androidtvremote2._tcp.local."
mdns_sd add_or_update record name: "102.1.168.192.in-addr.arpa."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "8.A.F.2.B.9.E.F.F.F.5.5.6.B.2.E.0.0.0.0.0.0.0.0.0.0.0.0.0.8.E.F.ip6.arpa."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "Android.local."

This log is not queried, just idle:

❯ ./test.exe
tide::log Logger started
    level DEBUG
tide::server Server listening on http://0.0.0.0:8081
mdns_sd new socket bind to 0.0.0.0:5353
mdns_sd created listening socket: Socket { raw: 316, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
mdns_sd new socket bind to 0.0.0.0:5353
mdns_sd register service ServiceInfo { ty_domain: "_test._tcp.local.", fullname: "test._test._tcp.local.", server: "192.168.1.126.local."
, addresses: {192.168.1.126}, port: 8081, host_ttl: 120, other_ttl: 4500, priority: 0, weight: 0, properties: {"ip": "192.168.1.126"} }
mdns_sd broadcast service test._test._tcp.local.
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false }, ttl:
4500, created: 1655403800082, refresh: 1655407400082 }, alias: "test._test._tcp.local." }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsSrv { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 33, class: 1, unique: true }, ttl:
 120, created: 1655403800083, refresh: 1655403896083 }, priority: 0, weight: 0, host: "192.168.1.126.local.", port: 8081 }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsTxt { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 16, class: 1, unique: true }, ttl:
 4500, created: 1655403800083, refresh: 1655407400083 }, text: [16, 105, 112, 61, 49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 49, 50, 54] }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsAddress { record: DnsRecord { entry: DnsEntry { name: "192.168.1.126.local.", ty: 1, class: 1, unique: true }, ttl: 120,
 created: 1655403800084, refresh: 1655403896084 }, address: 192.168.1.126 }
mdns_sd Sending response to SockAddr { ss_family: 2, len: 16 }: 0 questions 4 answers 0 authorities 0 additional
mdns_sd writing text length 17
mdns_sd sent out 132 bytes on socket Socket { raw: 336, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
mdns_sd received 132 bytes
mdns_sd read_header: id 0, 0 questions 4 answers 0 authorities 0 additionals
mdns_sd read_questions: 0
mdns_sd read_others: 4
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, created: 16
55403800086, refresh: 1655407400086 }, alias: "test._test._tcp.local." }
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 33, class: 1, unique: true }, ttl: 120, created: 16
55403800086, refresh: 1655403896086 }, priority: 0, weight: 0, host: "192.168.1.126.local.", port: 8081 }
mdns_sd DnsTxt { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 16, class: 1, unique: true }, ttl: 4500, created: 1
655403800087, refresh: 1655407400087 }, text: [16, 105, 112, 61, 49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 49, 50, 54] }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "192.168.1.126.local.", ty: 1, class: 1, unique: true }, ttl: 120, created: 1655403
800087, refresh: 1655403896087 }, address: 192.168.1.126 }
mdns_sd handle_response: 4 answers 0 authorities 0 additionals
mdns_sd add_or_update record name: "_test._tcp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "test._test._tcp.local."
mdns_sd add_or_update record name: "test._test._tcp.local."
mdns_sd add_or_update record name: "192.168.1.126.local."
mdns_sd announce service: test._test._tcp.local.
mdns_sd broadcast service test._test._tcp.local.
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false }, ttl:
4500, created: 1655403801095, refresh: 1655407401095 }, alias: "test._test._tcp.local." }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsSrv { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 33, class: 1, unique: true }, ttl:
 120, created: 1655403801096, refresh: 1655403897096 }, priority: 0, weight: 0, host: "192.168.1.126.local.", port: 8081 }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsTxt { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 16, class: 1, unique: true }, ttl:
 4500, created: 1655403801096, refresh: 1655407401096 }, text: [16, 105, 112, 61, 49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 49, 50, 54] }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsAddress { record: DnsRecord { entry: DnsEntry { name: "192.168.1.126.local.", ty: 1, class: 1, unique: true }, ttl: 120,
 created: 1655403801097, refresh: 1655403897097 }, address: 192.168.1.126 }
mdns_sd Sending response to SockAddr { ss_family: 2, len: 16 }: 0 questions 4 answers 0 authorities 0 additional
mdns_sd writing text length 17
mdns_sd sent out 132 bytes on socket Socket { raw: 336, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
mdns_sd received 132 bytes
mdns_sd read_header: id 0, 0 questions 4 answers 0 authorities 0 additionals
mdns_sd read_questions: 0
mdns_sd read_others: 4
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, created: 16
55403801099, refresh: 1655407401099 }, alias: "test._test._tcp.local." }
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 33, class: 1, unique: true }, ttl: 120, created: 16
55403801099, refresh: 1655403897099 }, priority: 0, weight: 0, host: "192.168.1.126.local.", port: 8081 }
mdns_sd DnsTxt { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 16, class: 1, unique: true }, ttl: 4500, created: 1
655403801100, refresh: 1655407401100 }, text: [16, 105, 112, 61, 49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 49, 50, 54] }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "192.168.1.126.local.", ty: 1, class: 1, unique: true }, ttl: 120, created: 1655403
801100, refresh: 1655403897100 }, address: 192.168.1.126 }
mdns_sd handle_response: 4 answers 0 authorities 0 additionals
mdns_sd add_or_update record name: "_test._tcp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "test._test._tcp.local."
mdns_sd add_or_update record name: "test._test._tcp.local."
mdns_sd add_or_update record name: "192.168.1.126.local."
mdns_sd received 137 bytes
mdns_sd read_header: id 0, 3 questions 0 answers 3 authorities 0 additionals
mdns_sd read_questions: 3
mdns_sd read_others: 3
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 33, class: 1, unique: false }, ttl: 120, cr
eated: 1655403805322, refresh: 1655403901322 }, priority: 0, weight: 0, host: "Android.local.", port: 6466 }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "Android.local.", ty: 1, class: 1, unique: false }, ttl: 120, created: 165540380532
2, refresh: 1655403901322 }, address: 192.168.1.102 }
mdns_sd We don't support IPv6 TYPE_AAAA records
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 255, class: 1, unique: false } }
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "Android.local.", ty: 255, class: 1, unique: false } }
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "Android.local.", ty: 255, class: 1, unique: false } }
mdns_sd received 137 bytes
mdns_sd read_header: id 0, 3 questions 0 answers 3 authorities 0 additionals
mdns_sd read_questions: 3
mdns_sd read_others: 3
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 33, class: 1, unique: false }, ttl: 120, cr
eated: 1655403805629, refresh: 1655403901629 }, priority: 0, weight: 0, host: "Android.local.", port: 6466 }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "Android.local.", ty: 1, class: 1, unique: false }, ttl: 120, created: 165540380562
9, refresh: 1655403901629 }, address: 192.168.1.102 }
mdns_sd We don't support IPv6 TYPE_AAAA records
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 255, class: 1, unique: false } }
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "Android.local.", ty: 255, class: 1, unique: false } }
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "Android.local.", ty: 255, class: 1, unique: false } }
mdns_sd received 137 bytes
mdns_sd read_header: id 0, 3 questions 0 answers 3 authorities 0 additionals
mdns_sd read_questions: 3
mdns_sd read_others: 3
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 33, class: 1, unique: false }, ttl: 120, cr
eated: 1655403805834, refresh: 1655403901834 }, priority: 0, weight: 0, host: "Android.local.", port: 6466 }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "Android.local.", ty: 1, class: 1, unique: false }, ttl: 120, created: 165540380583
4, refresh: 1655403901834 }, address: 192.168.1.102 }
mdns_sd We don't support IPv6 TYPE_AAAA records
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 255, class: 1, unique: false } }
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "Android.local.", ty: 255, class: 1, unique: false } }
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "Android.local.", ty: 255, class: 1, unique: false } }
mdns_sd received 402 bytes
mdns_sd read_header: id 0, 0 questions 8 answers 0 authorities 4 additionals
mdns_sd read_questions: 0
mdns_sd read_others: 12
mdns_sd DnsTxt { record: DnsRecord { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 16, class: 1, unique: true }, ttl: 4500, cr
eated: 1655403806141, refresh: 1655407406141 }, text: [20, 98, 116, 61, 69, 48, 58, 66, 54, 58, 53, 53, 58, 57, 68, 58, 55, 57, 58, 57, 56] }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_services._dns-sd._udp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, crea
ted: 1655403806141, refresh: 1655407406141 }, alias: "_androidtvremote2._tcp.local." }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_androidtvremote2._tcp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, crea
ted: 1655403806142, refresh: 1655407406142 }, alias: "chromecast._androidtvremote2._tcp.local." }
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 33, class: 1, unique: true }, ttl: 120, cre
ated: 1655403806142, refresh: 1655403902142 }, priority: 0, weight: 0, host: "Android.local.", port: 6466 }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "102.1.168.192.in-addr.arpa.", ty: 12, class: 1, unique: true }, ttl: 120, created:
 1655403806142, refresh: 1655403902142 }, alias: "Android.local." }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "8.A.F.2.B.9.E.F.F.F.5.5.6.B.2.E.0.0.0.0.0.0.0.0.0.0.0.0.0.8.E.F.ip6.arpa.", ty: 12
, class: 1, unique: true }, ttl: 120, created: 1655403806143, refresh: 1655403902143 }, alias: "Android.local." }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "Android.local.", ty: 1, class: 1, unique: true }, ttl: 120, created: 1655403806143
, refresh: 1655403902143 }, address: 192.168.1.102 }
mdns_sd We don't support IPv6 TYPE_AAAA records
mdns_sd handle_response: 8 answers 0 authorities 4 additionals
mdns_sd add_or_update record name: "chromecast._androidtvremote2._tcp.local."
mdns_sd add_or_update record name: "_services._dns-sd._udp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "_androidtvremote2._tcp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "chromecast._androidtvremote2._tcp.local."
mdns_sd add_or_update record name: "102.1.168.192.in-addr.arpa."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "8.A.F.2.B.9.E.F.F.F.5.5.6.B.2.E.0.0.0.0.0.0.0.0.0.0.0.0.0.8.E.F.ip6.arpa."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "Android.local."
mdns_sd received 402 bytes
mdns_sd read_header: id 0, 0 questions 8 answers 0 authorities 4 additionals
mdns_sd read_questions: 0
mdns_sd read_others: 12
mdns_sd DnsTxt { record: DnsRecord { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 16, class: 1, unique: true }, ttl: 4500, cr
eated: 1655403807063, refresh: 1655407407063 }, text: [20, 98, 116, 61, 69, 48, 58, 66, 54, 58, 53, 53, 58, 57, 68, 58, 55, 57, 58, 57, 56] }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_services._dns-sd._udp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, crea
ted: 1655403807063, refresh: 1655407407063 }, alias: "_androidtvremote2._tcp.local." }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_androidtvremote2._tcp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, crea
ted: 1655403807063, refresh: 1655407407063 }, alias: "chromecast._androidtvremote2._tcp.local." }
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 33, class: 1, unique: true }, ttl: 120, cre
ated: 1655403807063, refresh: 1655403903063 }, priority: 0, weight: 0, host: "Android.local.", port: 6466 }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "102.1.168.192.in-addr.arpa.", ty: 12, class: 1, unique: true }, ttl: 120, created:
 1655403807064, refresh: 1655403903064 }, alias: "Android.local." }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "8.A.F.2.B.9.E.F.F.F.5.5.6.B.2.E.0.0.0.0.0.0.0.0.0.0.0.0.0.8.E.F.ip6.arpa.", ty: 12
, class: 1, unique: true }, ttl: 120, created: 1655403807064, refresh: 1655403903064 }, alias: "Android.local." }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "Android.local.", ty: 1, class: 1, unique: true }, ttl: 120, created: 1655403807064
, refresh: 1655403903064 }, address: 192.168.1.102 }
mdns_sd We don't support IPv6 TYPE_AAAA records
mdns_sd handle_response: 8 answers 0 authorities 4 additionals
mdns_sd add_or_update record name: "chromecast._androidtvremote2._tcp.local."
mdns_sd add_or_update record name: "_services._dns-sd._udp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "_androidtvremote2._tcp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "chromecast._androidtvremote2._tcp.local."
mdns_sd add_or_update record name: "102.1.168.192.in-addr.arpa."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "8.A.F.2.B.9.E.F.F.F.5.5.6.B.2.E.0.0.0.0.0.0.0.0.0.0.0.0.0.8.E.F.ip6.arpa."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "Android.local."

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

And this is the one when I run an example bundled with mdns-sd:

❯ ./test.exe
tide::log Logger started
    level DEBUG
mdns_sd new socket bind to 0.0.0.0:5353
mdns_sd created listening socket: Socket { raw: 320, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
tide::server Server listening on http://0.0.0.0:8081
mdns_sd new socket bind to 0.0.0.0:5353
mdns_sd register service ServiceInfo { ty_domain: "_test._tcp.local.", fullname: "test._test._tcp.local.", server: "192.168.1.126.local."
, addresses: {192.168.1.126}, port: 8081, host_ttl: 120, other_ttl: 4500, priority: 0, weight: 0, properties: {"ip": "192.168.1.126"} }
mdns_sd broadcast service test._test._tcp.local.
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false }, ttl:
4500, created: 1655403917288, refresh: 1655407517288 }, alias: "test._test._tcp.local." }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsSrv { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 33, class: 1, unique: true }, ttl:
 120, created: 1655403917288, refresh: 1655404013288 }, priority: 0, weight: 0, host: "192.168.1.126.local.", port: 8081 }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsTxt { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 16, class: 1, unique: true }, ttl:
 4500, created: 1655403917289, refresh: 1655407517289 }, text: [16, 105, 112, 61, 49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 49, 50, 54] }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsAddress { record: DnsRecord { entry: DnsEntry { name: "192.168.1.126.local.", ty: 1, class: 1, unique: true }, ttl: 120,
 created: 1655403917289, refresh: 1655404013289 }, address: 192.168.1.126 }
mdns_sd Sending response to SockAddr { ss_family: 2, len: 16 }: 0 questions 4 answers 0 authorities 0 additional
mdns_sd writing text length 17
mdns_sd sent out 132 bytes on socket Socket { raw: 340, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
mdns_sd received 132 bytes
mdns_sd read_header: id 0, 0 questions 4 answers 0 authorities 0 additionals
mdns_sd read_questions: 0
mdns_sd read_others: 4
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, created: 16
55403917291, refresh: 1655407517291 }, alias: "test._test._tcp.local." }
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 33, class: 1, unique: true }, ttl: 120, created: 16
55403917291, refresh: 1655404013291 }, priority: 0, weight: 0, host: "192.168.1.126.local.", port: 8081 }
mdns_sd DnsTxt { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 16, class: 1, unique: true }, ttl: 4500, created: 1
655403917292, refresh: 1655407517292 }, text: [16, 105, 112, 61, 49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 49, 50, 54] }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "192.168.1.126.local.", ty: 1, class: 1, unique: true }, ttl: 120, created: 1655403
917292, refresh: 1655404013292 }, address: 192.168.1.126 }
mdns_sd handle_response: 4 answers 0 authorities 0 additionals
mdns_sd add_or_update record name: "_test._tcp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "test._test._tcp.local."
mdns_sd add_or_update record name: "test._test._tcp.local."
mdns_sd add_or_update record name: "192.168.1.126.local."
mdns_sd announce service: test._test._tcp.local.
mdns_sd broadcast service test._test._tcp.local.
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false }, ttl:
4500, created: 1655403918301, refresh: 1655407518301 }, alias: "test._test._tcp.local." }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsSrv { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 33, class: 1, unique: true }, ttl:
 120, created: 1655403918302, refresh: 1655404014302 }, priority: 0, weight: 0, host: "192.168.1.126.local.", port: 8081 }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsTxt { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 16, class: 1, unique: true }, ttl:
 4500, created: 1655403918302, refresh: 1655407518302 }, text: [16, 105, 112, 61, 49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 49, 50, 54] }
mdns_sd Check for add_answer_at_time
mdns_sd add_answer push: DnsAddress { record: DnsRecord { entry: DnsEntry { name: "192.168.1.126.local.", ty: 1, class: 1, unique: true }, ttl: 120,
 created: 1655403918303, refresh: 1655404014303 }, address: 192.168.1.126 }
mdns_sd Sending response to SockAddr { ss_family: 2, len: 16 }: 0 questions 4 answers 0 authorities 0 additional
mdns_sd writing text length 17
mdns_sd sent out 132 bytes on socket Socket { raw: 340, local_addr: Some(SockAddr { ss_family: 2, len: 16 }), peer_addr: None }
mdns_sd received 132 bytes
mdns_sd read_header: id 0, 0 questions 4 answers 0 authorities 0 additionals
mdns_sd read_questions: 0
mdns_sd read_others: 4
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_test._tcp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, created: 16
55403918305, refresh: 1655407518305 }, alias: "test._test._tcp.local." }
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 33, class: 1, unique: true }, ttl: 120, created: 16
55403918305, refresh: 1655404014305 }, priority: 0, weight: 0, host: "192.168.1.126.local.", port: 8081 }
mdns_sd DnsTxt { record: DnsRecord { entry: DnsEntry { name: "test._test._tcp.local.", ty: 16, class: 1, unique: true }, ttl: 4500, created: 1
655403918306, refresh: 1655407518306 }, text: [16, 105, 112, 61, 49, 57, 50, 46, 49, 54, 56, 46, 49, 46, 49, 50, 54] }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "192.168.1.126.local.", ty: 1, class: 1, unique: true }, ttl: 120, created: 1655403
918306, refresh: 1655404014306 }, address: 192.168.1.126 }
mdns_sd handle_response: 4 answers 0 authorities 0 additionals
mdns_sd add_or_update record name: "_test._tcp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "test._test._tcp.local."
mdns_sd add_or_update record name: "test._test._tcp.local."
mdns_sd add_or_update record name: "192.168.1.126.local."
mdns_sd received 110 bytes
mdns_sd read_header: id 0, 3 questions 0 answers 0 authorities 1 additionals
mdns_sd read_questions: 3
mdns_sd read_others: 1
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "lb._dns-sd._udp.local.", ty: 12, class: 1, unique: false } }
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "_companion-link._tcp.local.", ty: 12, class: 1, unique: false } }
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "_homekit._tcp.local.", ty: 12, class: 1, unique: false } }
mdns_sd received 40 bytes
mdns_sd read_header: id 0, 1 questions 0 answers 0 authorities 0 additionals
mdns_sd read_questions: 1
mdns_sd read_others: 0
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "_googlecast._tcp.local.", ty: 12, class: 1, unique: false } }
mdns_sd received 80 bytes
mdns_sd read_header: id 0, 1 questions 0 answers 0 authorities 0 additionals
mdns_sd read_questions: 1
mdns_sd read_others: 0
mdns_sd question: DnsQuestion { entry: DnsEntry { name: "chromecast-b9095dcac2a66e3f1f3b10a62db9e8c0._googlecast._tcp.local.", ty: 33, class: 1, unique:
 false } }
mdns_sd received 334 bytes
mdns_sd read_header: id 0, 0 questions 1 answers 0 authorities 3 additionals
mdns_sd read_questions: 0
mdns_sd read_others: 4
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_googlecast._tcp.local.", ty: 12, class: 1, unique: false }, ttl: 120, created: 16
55403932298, refresh: 1655404028298 }, alias: "chromecast-b9095dcac2a66e3f1f3b10a62db9e8c0._googlecast._tcp.local." }
mdns_sd DnsTxt { record: DnsRecord { entry: DnsEntry { name: "chromecast-b9095dcac2a66e3f1f3b10a62db9e8c0._googlecast._tcp.local.", ty: 16, class: 1, un
ique: true }, ttl: 4500, created: 1655403932298, refresh: 1655407532298 }, text: [35, 105, 100, 61, 98, 57, 48, 57, 53, 100, 99, 97, 99, 50, 97, 54,
 54, 101, 51, 102, 49, 102, 51, 98, 49, 48, 97, 54, 50, 100, 98, 57, 101, 56, 99, 48, 35, 99, 100, 61, 65, 68, 49, 56, 51, 51, 67, 53, 48, 69, 56, 6
7, 50, 54, 48, 56, 70, 50, 70, 66, 53, 50, 57, 67, 70, 52, 56, 51, 57, 51, 48, 65, 3, 114, 109, 61, 5, 118, 101, 61, 48, 53, 9, 109, 100, 61, 77, 73
, 66, 79, 88, 52, 18, 105, 99, 61, 47, 115, 101, 116, 117, 112, 47, 105, 99, 111, 110, 46, 112, 110, 103, 9, 102, 110, 61, 77, 73, 66, 79, 88, 52, 9
, 99, 97, 61, 52, 54, 51, 51, 54, 53, 4, 115, 116, 61, 48, 15, 98, 115, 61, 70, 65, 56, 70, 52, 51, 65, 65, 66, 69, 70, 70, 4, 110, 102, 61, 49, 3,
114, 115, 61] }
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "chromecast-b9095dcac2a66e3f1f3b10a62db9e8c0._googlecast._tcp.local.", ty: 33, class: 1, un
ique: true }, ttl: 120, created: 1655403932299, refresh: 1655404028299 }, priority: 0, weight: 0, host: "b9095dca-c2a6-6e3f-1f3b-10a62db9e8c0.local.
", port: 8009 }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "b9095dca-c2a6-6e3f-1f3b-10a62db9e8c0.local.", ty: 1, class: 1, unique: true }, ttl
: 120, created: 1655403932299, refresh: 1655404028299 }, address: 192.168.1.102 }
mdns_sd handle_response: 1 answers 0 authorities 3 additionals
mdns_sd add_or_update record name: "_googlecast._tcp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "chromecast-b9095dcac2a66e3f1f3b10a62db9e8c0._googlecast._tcp.local."
mdns_sd add_or_update record name: "chromecast-b9095dcac2a66e3f1f3b10a62db9e8c0._googlecast._tcp.local."
mdns_sd add_or_update record name: "b9095dca-c2a6-6e3f-1f3b-10a62db9e8c0.local."
mdns_sd received 147 bytes
mdns_sd read_header: id 0, 0 questions 1 answers 0 authorities 1 additionals
mdns_sd read_questions: 0
mdns_sd read_others: 2
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "chromecast-b9095dcac2a66e3f1f3b10a62db9e8c0._googlecast._tcp.local.", ty: 33, class: 1, un
ique: true }, ttl: 120, created: 1655403932301, refresh: 1655404028301 }, priority: 0, weight: 0, host: "b9095dca-c2a6-6e3f-1f3b-10a62db9e8c0.local.
", port: 8009 }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "b9095dca-c2a6-6e3f-1f3b-10a62db9e8c0.local.", ty: 1, class: 1, unique: true }, ttl
: 120, created: 1655403932302, refresh: 1655404028302 }, address: 192.168.1.102 }
mdns_sd handle_response: 1 answers 0 authorities 1 additionals
mdns_sd add_or_update record name: "chromecast-b9095dcac2a66e3f1f3b10a62db9e8c0._googlecast._tcp.local."
mdns_sd add_or_update record name: "b9095dca-c2a6-6e3f-1f3b-10a62db9e8c0.local."
mdns_sd received 402 bytes
mdns_sd read_header: id 0, 0 questions 8 answers 0 authorities 4 additionals
mdns_sd read_questions: 0
mdns_sd read_others: 12
mdns_sd DnsTxt { record: DnsRecord { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 16, class: 1, unique: true }, ttl: 4500, cr
eated: 1655403933115, refresh: 1655407533115 }, text: [20, 98, 116, 61, 69, 48, 58, 66, 54, 58, 53, 53, 58, 57, 68, 58, 55, 57, 58, 57, 56] }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_services._dns-sd._udp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, crea
ted: 1655403933115, refresh: 1655407533115 }, alias: "_androidtvremote2._tcp.local." }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "_androidtvremote2._tcp.local.", ty: 12, class: 1, unique: false }, ttl: 4500, crea
ted: 1655403933115, refresh: 1655407533115 }, alias: "chromecast._androidtvremote2._tcp.local." }
mdns_sd DnsSrv { record: DnsRecord { entry: DnsEntry { name: "chromecast._androidtvremote2._tcp.local.", ty: 33, class: 1, unique: true }, ttl: 120, cre
ated: 1655403933116, refresh: 1655404029116 }, priority: 0, weight: 0, host: "Android.local.", port: 6466 }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "102.1.168.192.in-addr.arpa.", ty: 12, class: 1, unique: true }, ttl: 120, created:
 1655403933116, refresh: 1655404029116 }, alias: "Android.local." }
mdns_sd DnsPointer { record: DnsRecord { entry: DnsEntry { name: "8.A.F.2.B.9.E.F.F.F.5.5.6.B.2.E.0.0.0.0.0.0.0.0.0.0.0.0.0.8.E.F.ip6.arpa.", ty: 12
, class: 1, unique: true }, ttl: 120, created: 1655403933116, refresh: 1655404029116 }, alias: "Android.local." }
mdns_sd DnsAddress { record: DnsRecord { entry: DnsEntry { name: "Android.local.", ty: 1, class: 1, unique: true }, ttl: 120, created: 1655403933117
, refresh: 1655404029117 }, address: 192.168.1.102 }
mdns_sd We don't support IPv6 TYPE_AAAA records
mdns_sd handle_response: 8 answers 0 authorities 4 additionals
mdns_sd add_or_update record name: "chromecast._androidtvremote2._tcp.local."
mdns_sd add_or_update record name: "_services._dns-sd._udp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "_androidtvremote2._tcp.local."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "chromecast._androidtvremote2._tcp.local."
mdns_sd add_or_update record name: "102.1.168.192.in-addr.arpa."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "8.A.F.2.B.9.E.F.F.F.5.5.6.B.2.E.0.0.0.0.0.0.0.0.0.0.0.0.0.8.E.F.ip6.arpa."
mdns_sd Not interested for any querier
mdns_sd add_or_update record name: "Android.local."

from mdns-sd.

keepsimple1 avatar keepsimple1 commented on August 16, 2024

From the logs, it seems that the registered service did not receive the query packets. It is possible the query never sent out packets over the network successfully, i.e. related to the firewall like @indietyp said.

Then I tried something similar on my Windows machine by copying query.exe to a different location, and then run it. Now I got a pop-up message from Windows Defender Firewall like this:

image

If I don't Allow access via this firewall message, the query.exe has the same problem as you reported. But if I select Private networks ..., and click Allow access, then query.exe works as expected. Once I gave query.exe the access, it will no longer ask me the next time.

Have you seen any Windows Defender Firewall pop-up message as above? Is there a way for you to check the firewall settings? e.g. the Private networks and Public networks setting, and "Allow an app or feature through Windows Defender Firewall" setting.

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

Yes, I've allowed access to both public and private networks. I've also built it in release mode and allowed it again, still doesn't work.

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

It's not a firewall issue, again dns-sd and another crate, https://crates.io/crates/astro-dnssd resolve the service from laptop without issues.

from mdns-sd.

keepsimple1 avatar keepsimple1 commented on August 16, 2024

Windows Defender Firewall rules are per app. I.e. rules for dns-sd and query.exe are separate. In fact, different copies of query.exe would have different rules.

Could you open "Windows Defender Firewall" and then check the "Advanced settings" , look for query.exe in the list (and maybe dns-sd to compare).
windows-defender-firewall-setting

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

query.exe with added logging:
image
Bonjour(dns-sd.exe is part of bonjour and relies on bonjour service):
image

from mdns-sd.

keepsimple1 avatar keepsimple1 commented on August 16, 2024

I cannot see any issue, but could you please double check "Inbound Rules", "Outbound Rules" and "Monitoring" -> "Firewall" ?

image

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

There isn't any block rule in any category, for the executables in question and for everything that has mDNS in the name is allowed and unblocked

from mdns-sd.

keepsimple1 avatar keepsimple1 commented on August 16, 2024

If the firewall settings are all good, then I would debug the code itself. I cannot reproduce this issue locally, but from the logs, the symptom seems to be that the querier did not receive any packets from the responder, and the responder did not receive any packets from the querier.

Do you have Wireshark or something like it to capture the packets? One thing I would try is:

  1. Start the querier. It should send out the query multicast packets. Check Wireshark on the responder to see if the query packets are received.

  2. Start the responder. It should send out its service records in multicast packets. Check Wireshark on the querier machine to see if these packets are received. Then check the querier debug log to see if our code received these packets.

  3. The querier should continue to send query packets, so we can check the responder log to see if our code in responder received any packets from the querier.

If there is a difference between what Wireshark reported and what our code logged, then it is something can be further looked into.

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

Ok I'll take a look when I have time next week. Thanks!

from mdns-sd.

keepsimple1 avatar keepsimple1 commented on August 16, 2024

@anenankhu I'm curious if the problem is resolved for you. If not, please let me know your findings and I will also think about how we can improve the debugging of this problem.

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

Looks like it was something with the state of my machines. I've rebooted everything and started over, and now it's working. Could it have been that multiple instances of mdns-sd acting up as a daemon conflict with each other?

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

Alright, it worked briefly but not anymore. In wireshark, I don't see any outgoing mdns queries from laptop's IP, despite log saying it's sending a query.

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

I found the issue, I think. mdns-sd querier binds(sends queries?) to(using?) a wrong interface, in my case it is a Hyper-V Virtual Ethernet Adapter. All queries go to that network which is 172.17.176.0/24

However my LAN is 192.168.1.0/24, and in laptop's case it's WiFi.

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

And it works on desktop because it doesn't have that Hyper-V Virtual Ethernet Adapter.

from mdns-sd.

keepsimple1 avatar keepsimple1 commented on August 16, 2024

Good findings @anenankhu ! That makes sense as we currently let the OS pick the outgoing interface. I will take a look what we can do.

from mdns-sd.

anenankhu avatar anenankhu commented on August 16, 2024

@keepsimple1 thank you!

from mdns-sd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.