In ubuntu and other Linux systems, domain names are resolved through the resolve. conf file. You can view the following through man resolve. conf:
The resolver is a set of routines in the C library that provide access to the Internet Domain Name System (DNS ). the resolver configuration file contains information that is read by the resolver routines the first time they are invoked by a process. the file is designed to be human readable and contains a list of keywords with values that provide varous types of resolver information. if this file doesn' t exist the only name server to be queried will be on the local machine; the domain name is determined from the hostname and the domain search path is constructed from the domain name.
Therefore, DNS resolution is performed by C-library functions. In the bionic/libc/docs/overview.txt file of Android, we can also see:
NS resolver:
Bionic uses a NetBSD-derived resolver library which has been modified in the following ways:
-Don't implement the name-server-Switch feature (a.k. A. <nsswitch. h>)
-Read/system/etc/resolv. conf instead of/etc/resolv. conf
-Read the list of servers from system properties. the code looks for 'Net. dns1 ', 'Net. dns2 ', Etc .. each property shoshould contain the IP address of a DNS server.
These properties are set/modified by other parts of the Android system (e.g. The DHCPD Daemon ).
The implementation also supports per-process DNS Server LIST, using the properties 'Net. dns1. <pid> ', 'Net. dns2. <pid> ', Etc... where <pid> stands for the numerical ID of the current process.
-When implements Ming a query, use a properly randomized query ID (instead of a incremented one), for increased security.
-When Ming a query, bind the local client socket to a random port for increased security.
-Get rid of * unique * unfortunate thread-safety issues in the original code
Bionic does ** not * expose implementation details of its DNS resolver; the content of <ARPA/nameser. h> is intentionally blank. The resolver implementation might change completely in the future.
Therefore, Android focuses on attributes such as resolv. conf and net. dns1.
You can use getprop in the ADB shell to view the attributes. net. dns1, net. dns2 and net. tiwlan0.dns1 and net. tiwlan0.dns2, net. rmnet0.dns1 and net. rmnet0.dns2 and other attributes.