代码之家  ›  专栏  ›  技术社区  ›  watery

查询本地lan主机名时取消绑定dns服务器响应

  •  1
  • watery  · 技术社区  · 6 年前

    我在Windows上,我已经配置了 Unbound 用作Android Emulator的DNS(自 -dns-server 似乎不起作用*)。DNS服务器取自 ipconfig /all .

    我可以从未绑定的日志中看出,它正在查询我试图从emulator浏览的任何网页,但本地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地址时,我得到了相同的行为,当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服务器的配置是正确的。

    0 回复  |  直到 6 年前