commit | ceb3c02582b565148db3ee0f595f6705543974d9 | [log] [tgz] |
---|---|---|
author | chenbruce <chenbruce@google.com> | Tue Jun 15 21:36:19 2021 +0800 |
committer | chenbruce <chenbruce@google.com> | Fri Jun 25 18:37:47 2021 +0800 |
tree | 441e49910a5707ee4a7b0b2f8cc0aba58dfa93d8 | |
parent | dfc33122136300626395550628105e0c180e9750 [diff] |
Enable mDNS .local resolution This change implements "5.1 One-Shot multicast DNS Queries" in RFC 6762 to send standard DNS queries blindly to 224.0.0.251:5353 or [FF02::FB]:5353. mDNS resolution is transparently supported by calling getaddrinfo() with a hostname ending in "*.local". If the device exists, getaddrinfo() returns the local addresses. Otherwise, the query will timeout and return NODATA. This feature doesn't support reverse-lookups with getnameinfo(). Bug: 140857615 Test: cd packages/modules/DnsResolver && atest Change-Id: Ie65f220de8c6e5c6e21403ec1f717cf6929023a6
This code uses LOG(X) for logging. Log levels are VERBOSE,DEBUG,INFO,WARNING and ERROR. The default setting is WARNING and logs relate to WARNING and ERROR will be shown. If you want to enable the DEBUG level logs, using following command. adb shell service call dnsresolver 10 i32 1 VERBOSE 0 DEBUG 1 INFO 2 WARNING 3 ERROR 4 Verbose resolver logs could contain PII -- do NOT enable in production builds.