commit | fd837fa06736468ba83b5c430cdf0ccbc97eb1fe | [log] [tgz] |
---|---|---|
author | chenbruce <chenbruce@google.com> | Tue Oct 29 18:35:36 2019 +0800 |
committer | chenbruce <chenbruce@google.com> | Wed Jan 08 11:54:49 2020 +0800 |
tree | 73db0e98e13d48aae3922dda04f5adf0fc440e3f | |
parent | c727677fabb9b42dfaabaf9d4da1ca51454b874d [diff] |
Customized hostname/address table for DNS query - Some Android OEMs would like to create their own customized table (hostname/address mapping lists) that the resolver looks up before querying dns servers and gets the result directly. - About DNS query, resolver checks system/etc/hosts first. If no data is found, resolver will query dns from the server. We add a new parameter to ResolverParamsParcel for OEMs to customize the table and OEMs can use setDnsConfigurationForNetwork to create the hostname/address lists. After OEMs create their own lists,the dns query will be following sequence. system/ect/hosts -> customized table -> dns server - Add test cases: GetAddrInfoFromCustTable, GetAddrInfoFromCustTable_InvalidInput, GetAddrInfoFromCustTable_Modify Bug: 122998288 Test: cd packages/modules/DnsResolver && atest Change-Id: I7a2d689de74f0076f0115e0cb20fdc028903ae86
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.