Allow DNS lookup in no default network case

Before aosp/2368708, DNS lookup of "localhost" is allowed when apps
don't select a network and there is no default network. It is because
the "localhost" exists in etc/hosts. The etc/hosts lookups take
precedence over routing decisions. After aosp/2368708, the same DNS
lookup is blocked by evaluateDomainNameCallback. It is because
app_netid in network context is 0, and there is no corresponding
Network object in netd.

DNS lookup can be allowed in this case because DNS packets will not be
sent out of the device if the hostname is not listed in the etc/hosts.

Bug: 265503240
Bug: 263219497
Test: atest com.android.server.connectivity.VpnTest
Change-Id: Iff760770706cce23cf25661593dcc67d0b0685e9
1 file changed
tree: e25e99fb7a8e972add3355dcef95f3def21bd932
  1. client/
  2. include/
  3. netutils_wrappers/
  4. server/
  5. tests/
  6. .editorconfig
  7. Android.bp
  8. NOTICE
  9. OWNERS
  10. PREUPLOAD.cfg
  11. TEST_MAPPING