我在 Windows 上,并且我已将Unbound配置为用作 Android 模拟器的 DNS(因为-dns-server
似乎不起作用*)。DNS 服务器取自 给出的列表ipconfig /all
。
我可以从 Unbound 日志中得知,正在查询我尝试从模拟器浏览的任何网页,但本地 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
*:事实上,当我向模拟器提供我在 Unbound 中配置的相同 DNS ip 地址时,我得到相同的行为,本地 LAN 名称在 Internet 名称(如 www.yahoo.com)工作时无法解析。
这是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服务器配置是正确的。