android是如何做DNS解析的

Android系统的DNS解析不同于Linux,它使用了NetBSD派生的解析库,并进行了修改。解析过程涉及/resolv.conf文件以及system properties中的'net.dns1'、'net.dns2'等属性,这些属性由Android系统的其他组件如dhcpd守护进程设置。此外,Android还支持进程级DNS服务器列表,并在查询时使用随机Query ID和绑定随机本地端口以提高安全性。
摘要由CSDN通过智能技术生成

通过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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值