我在Windows上,并且已将Unbound配置为用作Android仿真器的DNS(因为-dns-server
似乎不起作用*)。 DNS服务器取自ipconfig /all
给出的列表。
我可以从“未绑定”日志中得知,正在尝试从模拟器浏览的任何网页都在查询该查询,但是本地LAN名称无法解析,而Internet名称可以解析。
从日志中我看不到任何回报:
info: 10.241.36.145 <local-lan-server-name>. AAAA IN
info: resolving <local-lan-server-name>. AAAA IN
info: response for <local-lan-server-name>. AAAA IN
info: reply from <.> 10.241.11.48#53
info: query response was THROWAWAY
info: response for <local-lan-server-name>. AAAA IN
info: reply from <.> 10.241.11.48#53
info: query response was THROWAWAY
info: response for <local-lan-server-name>. AAAA IN
info: reply from <.> 10.241.11.48#53
info: query response was THROWAWAY
info: response for <local-lan-server-name>. AAAA IN
info: reply from <.> 10.241.11.48#53
info: query response was THROWAWAY
info: response for <local-lan-server-name>. AAAA IN
info: reply from <.> 10.241.11.48#53
info: query response was THROWAWAY
info: 10.241.36.145 <local-lan-server-name>. AAAA IN SERVFAIL 0.007000 0 29
同时输入Yahoo主机名:
info: 10.241.36.145 www.yahoo.com. AAAA IN
debug: validator[module 0] operate: extstate:module_state_initial event:module_event_new
info: validator operate: query www.yahoo.com. AAAA IN
debug: iterator[module 1] operate: extstate:module_state_initial event:module_event_pass
info: resolving www.yahoo.com. AAAA IN
info: processQueryTargets: www.yahoo.com. AAAA IN
info: sending query: www.yahoo.com. AAAA IN
debug: sending to target: <.> 10.241.6.11#53
debug: cache memory msg=70788 rrset=77712 infra=8555 val=71408
debug: iterator[module 1] operate: extstate:module_wait_reply event:module_event_reply
info: iterator operate: query www.yahoo.com. AAAA IN
info: sanitize: removing extraneous answer RRset: atsv2-fp-shed.wg1.b.yahoo.com. AAAA IN
info: response for www.yahoo.com. AAAA IN
info: reply from <.> 10.241.6.11#53
info: query response was CNAME
info: resolving www.yahoo.com. AAAA IN
info: processQueryTargets: www.yahoo.com. AAAA IN
info: sending query: atsv2-fp-shed.wg1.b.yahoo.com. AAAA IN
debug: sending to target: <.> 10.241.6.11#53
debug: cache memory msg=70788 rrset=77928 infra=8555 val=71408
debug: iterator[module 1] operate: extstate:module_wait_reply event:module_event_reply
info: iterator operate: query www.yahoo.com. AAAA IN
info: iterator operate: chased to atsv2-fp-shed.wg1.b.yahoo.com. AAAA IN
info: response for www.yahoo.com. AAAA IN
info: reply from <.> 10.241.6.11#53
info: query response was ANSWER
info: finishing processing for www.yahoo.com. AAAA IN
这是配置:
# Unbound configuration file on windows.
# See example.conf for more settings and syntax
server:
# verbosity level 0-4 of logging
verbosity: 3
interface: 0.0.0.0
infra-cache-min-rtt: 250
access-control: 0.0.0.0/0 allow_snoop
do-ip4: yes
do-ip6: no
do-udp: yes
do-tcp: yes
logfile: "C:\unbound.log"
log-time-ascii: yes
log-queries: yes
log-replies: yes
unblock-lan-zones: yes
insecure-lan-zones: yes
auto-trust-anchor-file: "C:\Program Files\Unbound\root.key"
forward-zone:
name: "."
forward-addr: 10.241.6.11
forward-addr: 10.241.11.48
forward-addr: 10.241.11.49
*:实际上,当我给仿真器使用在“未绑定”中配置的相同DNS IP地址时,我会得到相同的行为,当Internet地址(例如www.yahoo.com)工作时,本地LAN名称不会解析。
nslookup
关于该主机名的内容是这样的:
C:\> nslookup <local-lan-server-name>
Server: <dns-server-name>
Address: 10.241.11.48
Nome: <local-lan-server-name>
Address: 10.241.11.27
所以我认为DNS服务器配置正确。