通过ubuntu等Linux系统都是通过resolve.conf文件进行域名解析的,通过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 various 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.
所以DNS解析是由C库函数进行解析的,在Android中bionic/libc/docs/overview.txt文件中我们也可以看到:
NS resolver:
Bionic uses a NetBSD-derived resolver library which has been modified in the following ways:
- don't implement the name-server-switch feat