|author||chenbruce <firstname.lastname@example.org>||Tue Jun 15 21:36:19 2021 +0800|
|committer||chenbruce <email@example.com>||Fri Jun 25 18:37:47 2021 +0800|
Enable mDNS .local resolution This change implements "5.1 One-Shot multicast DNS Queries" in RFC 6762 to send standard DNS queries blindly to 126.96.36.199: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.