Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.1.5
    • Component/s: DNS
    • Labels:
      None
    • Environment:

      Debian 5.0.5 kernel 2.6.26-1-686 #1 SMP

      Description

      Server configured as forward proxy with SplitDNS enable. At start get system DNS server but at client request fail to resolve URL.

      record.config (DNS section)

      CONFIG proxy.config.dns.search_default_domains INT 1
      CONFIG proxy.config.dns.splitDNS.enabled INT 1
      CONFIG proxy.config.dns.splitdns.def_domain STRING lapampa.gov.ar
      CONFIG proxy.config.dns.url_expansions STRING NULL
      CONFIG proxy.config.dns.round_robin_nameservers INT 0
      CONFIG proxy.config.dns.nameservers STRING NULL
      CONFIG proxy.config.dns.validate_query_name INT 0

      splitdns.config
      dest_domain=lapampa.gov.ar named=10.2.1.72 serach_list=lapampa.gov.ar

      Debug:

      [TrafficServer] using root directory '/opt/trafficserver-2'
      [Sep 8 11:55:57.512]

      {3079767744} STATUS: opened var/log/trafficserver/diags.log
      [Sep 8 11:55:57.514] Server {3079767744}

      DEBUG: (http_aeua) [HttpConfig::init_aeua_filter] - Config: "etc/trafficserver/ae_ua.config"
      [Sep 8 11:55:57.514] Server

      {3079767744} DEBUG: (http_aeua) [HttpConfig::init_aeua_filter] - Opening config "etc/trafficserver/ae_ua.config"
      [Sep 8 11:55:57.514] Server {3079767744}

      DEBUG: (http_aeua) [HttpConfig::init_aeua_filter] - Added 0 REGEXP filters
      [Sep 8 11:55:57.514] Server

      {3079767744} DEBUG: (http_aeua) [init_http_aeua_filter] - Total loaded 0 REGEXP for Accept-Enconding/User-Agent filtering
      [Sep 8 11:55:57.548] Server {3079767744}

      DEBUG: (dns) ink_dns_init: called with init_called = 0
      [Sep 8 11:55:57.587] Server

      {3079767744} DEBUG: (dns) localhost=h6514asi106.glp.gov.ar
      [Sep 8 11:55:57.587] Server {3079767744}

      DEBUG: (dns) Round-robin nameservers = 0
      [Sep 8 11:55:57.616] Server

      {3062635408} DEBUG: (dns) DNSHandler::startEvent_sdns: on thread2
      [Sep 8 11:55:57.616] Server {3062635408}

      DEBUG: (dns) open_con: opening connection 10.2.1.73:53
      [Sep 8 11:55:57.616] Server

      {3062635408} DEBUG: (dns) random port = 17507
      [Sep 8 11:55:57.616] Server {3062635408}

      DEBUG: (dns) opening connection 10.2.1.73:53 SUCCEEDED for 0
      [Sep 8 11:55:57.616] Server

      {3063688080} DEBUG: (dns) DNSHandler::startEvent_sdns: on thread1
      [Sep 8 11:55:57.616] Server {3063688080}

      DEBUG: (dns) open_con: opening connection 10.2.1.73:53
      [Sep 8 11:55:57.616] Server

      {3063688080} DEBUG: (dns) random port = 42681
      [Sep 8 11:55:57.616] Server {3063688080}

      DEBUG: (dns) opening connection 10.2.1.73:53 SUCCEEDED for 0
      [Sep 8 11:55:57.690] Server

      {3079767744} DEBUG: (http_init) proxy.config.connection_collapsing.hashtable_enabled = 0
      [Sep 8 11:55:57.690] Server {3079767744}

      DEBUG: (http_init) proxy.config.connection_collapsing.rww_wait_time = 0
      [Sep 8 11:55:57.690] Server

      {3079767744} DEBUG: (http_init) proxy.config.connection_collapsing.revalidate_window_period = 0
      [Sep 8 11:55:57.690] Server {3079767744}

      DEBUG: (http_init) proxy.config.http.redirection_enabled = 0
      [Sep 8 11:55:57.690] Server

      {3079767744} DEBUG: (http_init) proxy.config.http.number_of_redirections = 1
      [Sep 8 11:55:57.690] Server {3079767744}

      DEBUG: (http_init) proxy.config.http.post_copy_size = 2048
      [Sep 8 11:55:57.713] Server

      {3079767744} DEBUG: (dns) DNSHandler::startEvent: on thread0
      [Sep 8 11:55:57.713] Server {3079767744}

      DEBUG: (dns) open_con: opening connection 10.2.1.73:53
      [Sep 8 11:55:57.715] Server

      {3079767744} DEBUG: (dns) random port = 40576
      [Sep 8 11:55:57.715] Server {3079767744}

      DEBUG: (dns) opening connection 10.2.1.73:53 SUCCEEDED for 0
      .....
      +++++++++ Incoming Request +++++++++
      – State Machine Id: 0
      GET http://www.lapampa.gov.ar/ HTTP/1.1^M
      Host: www.lapampa.gov.ar^M
      User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.19) Gecko/2010072023 Iceweasel/3.0.6 (Debian-3.0.6-3)^M
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8^M
      Accept-Language: en-us,en;q=0.5^M
      Accept-Encoding: gzip,deflate^M
      Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7^M
      Keep-Alive: 300^M
      Proxy-Connection: keep-alive^M
      Cookie: LaPampa2_tpl=LaPampa2^M
      Cache-Control: max-age=0^M
      ^M
      [Sep 8 11:56:01.134] Server

      {3079767744} DEBUG: (http_trans) [DecideCacheLookup] Will do cache lookup.
      [Sep 8 11:56:01.134] Server {3079767744}

      DEBUG: (http_seq) [DecideCacheLookup] Will do cache lookup
      [Sep 8 11:56:01.134] Server

      {3079767744} DEBUG: (http_trans) Next action CACHE_LOOKUP; NULL
      [Sep 8 11:56:01.134] Server {3079767744}

      DEBUG: (http) [0] State Transition: API_READ_REQUEST_HDR -> CACHE_LOOKUP
      [Sep 8 11:56:01.134] Server

      {3079767744} DEBUG: (http_seq) [HttpSM::do_cache_lookup_and_read] Issuing cache lookup
      [Sep 8 11:56:01.134] Server {3079767744}

      DEBUG: (http_cache) [0] [&HttpCacheSM::state_cache_open_read, CACHE_EVENT_OPEN_READ_FAILED]
      [Sep 8 11:56:01.135] Server

      {3079767744} DEBUG: (http) [0] [HttpSM::main_handler, CACHE_EVENT_OPEN_READ_FAILED]
      [Sep 8 11:56:01.135] Server {3079767744}

      DEBUG: (http) [0] [&HttpSM::state_cache_open_read, CACHE_EVENT_OPEN_READ_FAILED]
      [Sep 8 11:56:01.135] Server

      {3079767744} DEBUG: (http) [0] cache_open_read - CACHE_EVENT_OPEN_READ_FAILED
      [Sep 8 11:56:01.135] Server {3079767744}

      DEBUG: (http) [state_cache_open_read] open read failed.
      [Sep 8 11:56:01.135] Server

      {3079767744} DEBUG: (http_trans) [HttpTransact::HandleCacheOpenRead]
      [Sep 8 11:56:01.135] Server {3079767744}

      DEBUG: (http_trans) CacheOpenRead – miss
      [Sep 8 11:56:01.135] Server

      {3079767744} DEBUG: (http_trans) Next action DNS_LOOKUP; OSDNSLookup
      [Sep 8 11:56:01.135] Server {3079767744}

      DEBUG: (http) [0] State Transition: CACHE_LOOKUP -> DNS_LOOKUP
      [Sep 8 11:56:01.135] Server

      {3079767744} DEBUG: (http_seq) [HttpStateMachineGet::do_hostdb_lookup] Doing DNS Lookup
      [Sep 8 11:56:01.135] Server {3079767744}

      DEBUG: (dns) received query www.lapampa.gov.ar type = 1, timeout = 0
      [Sep 8 11:56:01.137] Server

      {3079767744} DEBUG: (dns) enqueing query www.lapampa.gov.ar
      [Sep 8 11:56:01.137] Server {3079767744}

      DEBUG: (dns) adding first to collapsing queue
      [Sep 8 11:56:01.137] Server

      {3079767744} DEBUG: (dns) in_flight: 0, dns_max_dns_in_flight: 60
      [Sep 8 11:56:01.137] Server {3079767744}

      DEBUG: (dns) send query for www.lapampa.gov.ar to fd 34
      [Sep 8 11:56:01.137] Server

      {3079767744} DEBUG: (dns) sent qname = www.lapampa.gov.ar, id = 50074, nameserver = 0
      [Sep 8 11:56:01.137] Server {3079767744}

      DEBUG: (dns) sent_one: failover_number for resolver 0 is 1
      [Sep 8 11:56:01.137] Server

      {3063688080} DEBUG: (dns) in_flight: 1, dns_max_dns_in_flight: 60
      [Sep 8 11:56:01.138] Server {3079767744} DEBUG: (dns) received packet size = 52
      [Sep 8 11:56:01.138] Server {3079767744} DEBUG: (dns) primary DNS response code = 0
      [Sep 8 11:56:01.138] Server {3079767744} DEBUG: (dns) unknown DNS id = 50074
      [Sep 8 11:56:01.141] Server {3063688080}

      DEBUG: (dns) in_flight: 1, dns_max_dns_in_flight: 60

      1. TS-435-3.diff
        19 kB
        Leif Hedstrom
      2. TS-435.patch
        5 kB
        mohan_zl

        Activity

        Hide
        Martin Leventan added a comment -

        I'm fix error on splitdns.config "serach_list=lapampa.gov.ar" to "search_list=lapampa.gov.ar", but same result.

        Show
        Martin Leventan added a comment - I'm fix error on splitdns.config "serach_list=lapampa.gov.ar" to "search_list=lapampa.gov.ar", but same result.
        Hide
        Leif Hedstrom added a comment -

        Targeting this for v2.1.4, but it might have to move out to v2.3.0 unless there is interest from someone to work on this.

        Show
        Leif Hedstrom added a comment - Targeting this for v2.1.4, but it might have to move out to v2.3.0 unless there is interest from someone to work on this.
        Hide
        mohan_zl added a comment -

        we have reproduce this problem when using latest trunk, and looks like something messed during queue and handler match:

        [Sep 8 11:55:57.616] Server

        {3062635408} DEBUG: (dns) DNSHandler::startEvent_sdns: on thread2
        [Sep 8 11:55:57.616] Server {3062635408}

        DEBUG: (dns) open_con: opening connection 10.2.1.73:53
        [Sep 8 11:55:57.616] Server

        {3063688080} DEBUG: (dns) DNSHandler::startEvent_sdns: on thread1
        [Sep 8 11:55:57.616] Server {3063688080}

        DEBUG: (dns) open_con: opening connection 10.2.1.73:53
        [Sep 8 11:55:57.713] Server

        {3079767744} DEBUG: (dns) DNSHandler::startEvent: on thread0
        [Sep 8 11:55:57.713] Server {3079767744}

        DEBUG: (dns) open_con: opening connection 10.2.1.73:53

        we have 3 thread connected to 10.2.1.73:53

        unknown DNS id = 50074

        show then dns result is mistake by other threads, it took the dns result a unknown dns pkt, and dropped, so you can not resolve any dns

        will patch it asap

        Show
        mohan_zl added a comment - we have reproduce this problem when using latest trunk, and looks like something messed during queue and handler match: [Sep 8 11:55:57.616] Server {3062635408} DEBUG: (dns) DNSHandler::startEvent_sdns: on thread2 [Sep 8 11:55:57.616] Server {3062635408} DEBUG: (dns) open_con: opening connection 10.2.1.73:53 [Sep 8 11:55:57.616] Server {3063688080} DEBUG: (dns) DNSHandler::startEvent_sdns: on thread1 [Sep 8 11:55:57.616] Server {3063688080} DEBUG: (dns) open_con: opening connection 10.2.1.73:53 [Sep 8 11:55:57.713] Server {3079767744} DEBUG: (dns) DNSHandler::startEvent: on thread0 [Sep 8 11:55:57.713] Server {3079767744} DEBUG: (dns) open_con: opening connection 10.2.1.73:53 we have 3 thread connected to 10.2.1.73:53 unknown DNS id = 50074 show then dns result is mistake by other threads, it took the dns result a unknown dns pkt, and dropped, so you can not resolve any dns will patch it asap
        Hide
        Leif Hedstrom added a comment -

        Cool. I have a few other minor DNS cleanups that I need to commit,
        should I just put that in there for this bug (It doesn't fix this
        problem, but makes things a bit cleaner).

        – leif

        Show
        Leif Hedstrom added a comment - Cool. I have a few other minor DNS cleanups that I need to commit, should I just put that in there for this bug (It doesn't fix this problem, but makes things a bit cleaner). – leif
        Hide
        mohan_zl added a comment -

        Hello, i have changed the DNC.cc file in iocore/dns packet, and experiment again. The result shows that this bug has been fixed.

        Show
        mohan_zl added a comment - Hello, i have changed the DNC.cc file in iocore/dns packet, and experiment again. The result shows that this bug has been fixed.
        Hide
        Leif Hedstrom added a comment -

        I'm reviewing this, and will commit as soon as I'm done.

        Show
        Leif Hedstrom added a comment - I'm reviewing this, and will commit as soon as I'm done.
        Hide
        Leif Hedstrom added a comment -

        Here's a slightly modified version of the patch, can you please review/ test this?

        Show
        Leif Hedstrom added a comment - Here's a slightly modified version of the patch, can you please review/ test this?
        Hide
        Leif Hedstrom added a comment -

        Some modifications to previous patches, please test and review. This is moderately tested only, head is spinning from reading DNS code all day...

        Show
        Leif Hedstrom added a comment - Some modifications to previous patches, please test and review. This is moderately tested only, head is spinning from reading DNS code all day...
        Hide
        Martin Leventan added a comment -

        Hi, I tried to apply and test the patch but i am getting a lot of failed messages

        ~/build/trafficserver-2.0.1$ patch --dry-run -p1 -i ../TS-435-3.diff
        patching file .gitignore
        Hunk #1 FAILED at 78.
        1 out of 1 hunk FAILED – saving rejects to file .gitignore.rej
        patching file iocore/dns/DNS.cc
        Hunk #1 FAILED at 133.
        Hunk #2 succeeded at 240 with fuzz 1 (offset -8 lines).
        Hunk #3 succeeded at 246 with fuzz 1 (offset -9 lines).
        Hunk #4 FAILED at 425.
        Hunk #5 FAILED at 631.
        Hunk #6 succeeded at 686 (offset 19 lines).
        Hunk #7 FAILED at 702.
        Hunk #8 succeeded at 718 (offset 19 lines).
        Hunk #9 FAILED at 897.
        Hunk #10 succeeded at 1660 (offset 66 lines).
        Hunk #11 FAILED at 1683.
        6 out of 11 hunks FAILED – saving rejects to file iocore/dns/DNS.cc.rej
        patching file iocore/dns/DNSConnection.cc
        Hunk #1 succeeded at 33 with fuzz 1 (offset 2 lines).
        Hunk #2 FAILED at 50.
        Hunk #3 succeeded at 74 (offset 2 lines).
        1 out of 3 hunks FAILED – saving rejects to file iocore/dns/DNSConnection.cc.rej
        patching file iocore/dns/P_DNSConnection.h
        Hunk #1 succeeded at 35 with fuzz 2 (offset -20 lines).
        Hunk #2 FAILED at 45.
        1 out of 2 hunks FAILED – saving rejects to file iocore/dns/P_DNSConnection.h.rej
        patching file iocore/dns/P_DNSProcessor.h
        Hunk #1 succeeded at 233 (offset 14 lines).
        Hunk #2 FAILED at 315.
        Hunk #3 succeeded at 325 (offset 14 lines).
        1 out of 3 hunks FAILED – saving rejects to file iocore/dns/P_DNSProcessor.h.rej
        patching file iocore/dns/SplitDNS.cc
        Hunk #1 succeeded at 320 with fuzz 1 (offset 82 lines).
        Hunk #2 FAILED at 349.
        Hunk #3 FAILED at 663.
        Hunk #4 succeeded at 742 (offset 145 lines).
        Hunk #5 FAILED at 819.
        Hunk #6 succeeded at 845 with fuzz 2 (offset 156 lines).
        3 out of 6 hunks FAILED – saving rejects to file iocore/dns/SplitDNS.cc.rej
        patching file iocore/net/P_UnixNet.h
        Hunk #1 FAILED at 246.
        Hunk #2 FAILED at 685.
        2 out of 2 hunks FAILED – saving rejects to file iocore/net/P_UnixNet.h.rej
        patching file iocore/net/UnixNet.cc
        Hunk #1 FAILED at 55.
        Hunk #2 FAILED at 140.
        Hunk #3 FAILED at 159.
        Hunk #4 succeeded at 210 with fuzz 1 (offset -90 lines).
        Hunk #5 FAILED at 231.
        Hunk #6 FAILED at 239.
        Hunk #7 FAILED at 257.
        Hunk #8 FAILED at 298.
        7 out of 8 hunks FAILED – saving rejects to file iocore/net/UnixNet.cc.rej
        patching file libinktomi++/ink_res_init.cc
        Hunk #1 FAILED at 728.
        1 out of 1 hunk FAILED – saving rejects to file libinktomi++/ink_res_init.cc.rej
        patching file proxy/Main.cc
        Hunk #1 succeeded at 1898 (offset -20 lines).

        Show
        Martin Leventan added a comment - Hi, I tried to apply and test the patch but i am getting a lot of failed messages ~/build/trafficserver-2.0.1$ patch --dry-run -p1 -i ../ TS-435 -3.diff patching file .gitignore Hunk #1 FAILED at 78. 1 out of 1 hunk FAILED – saving rejects to file .gitignore.rej patching file iocore/dns/DNS.cc Hunk #1 FAILED at 133. Hunk #2 succeeded at 240 with fuzz 1 (offset -8 lines). Hunk #3 succeeded at 246 with fuzz 1 (offset -9 lines). Hunk #4 FAILED at 425. Hunk #5 FAILED at 631. Hunk #6 succeeded at 686 (offset 19 lines). Hunk #7 FAILED at 702. Hunk #8 succeeded at 718 (offset 19 lines). Hunk #9 FAILED at 897. Hunk #10 succeeded at 1660 (offset 66 lines). Hunk #11 FAILED at 1683. 6 out of 11 hunks FAILED – saving rejects to file iocore/dns/DNS.cc.rej patching file iocore/dns/DNSConnection.cc Hunk #1 succeeded at 33 with fuzz 1 (offset 2 lines). Hunk #2 FAILED at 50. Hunk #3 succeeded at 74 (offset 2 lines). 1 out of 3 hunks FAILED – saving rejects to file iocore/dns/DNSConnection.cc.rej patching file iocore/dns/P_DNSConnection.h Hunk #1 succeeded at 35 with fuzz 2 (offset -20 lines). Hunk #2 FAILED at 45. 1 out of 2 hunks FAILED – saving rejects to file iocore/dns/P_DNSConnection.h.rej patching file iocore/dns/P_DNSProcessor.h Hunk #1 succeeded at 233 (offset 14 lines). Hunk #2 FAILED at 315. Hunk #3 succeeded at 325 (offset 14 lines). 1 out of 3 hunks FAILED – saving rejects to file iocore/dns/P_DNSProcessor.h.rej patching file iocore/dns/SplitDNS.cc Hunk #1 succeeded at 320 with fuzz 1 (offset 82 lines). Hunk #2 FAILED at 349. Hunk #3 FAILED at 663. Hunk #4 succeeded at 742 (offset 145 lines). Hunk #5 FAILED at 819. Hunk #6 succeeded at 845 with fuzz 2 (offset 156 lines). 3 out of 6 hunks FAILED – saving rejects to file iocore/dns/SplitDNS.cc.rej patching file iocore/net/P_UnixNet.h Hunk #1 FAILED at 246. Hunk #2 FAILED at 685. 2 out of 2 hunks FAILED – saving rejects to file iocore/net/P_UnixNet.h.rej patching file iocore/net/UnixNet.cc Hunk #1 FAILED at 55. Hunk #2 FAILED at 140. Hunk #3 FAILED at 159. Hunk #4 succeeded at 210 with fuzz 1 (offset -90 lines). Hunk #5 FAILED at 231. Hunk #6 FAILED at 239. Hunk #7 FAILED at 257. Hunk #8 FAILED at 298. 7 out of 8 hunks FAILED – saving rejects to file iocore/net/UnixNet.cc.rej patching file libinktomi++/ink_res_init.cc Hunk #1 FAILED at 728. 1 out of 1 hunk FAILED – saving rejects to file libinktomi++/ink_res_init.cc.rej patching file proxy/Main.cc Hunk #1 succeeded at 1898 (offset -20 lines).
        Hide
        Leif Hedstrom added a comment -

        This patch is for "trunk" only (or possibly 2.1.4). There are no plans to backport to 2.0.x, yet at least.

        Show
        Leif Hedstrom added a comment - This patch is for "trunk" only (or possibly 2.1.4). There are no plans to backport to 2.0.x, yet at least.
        Hide
        Zhao Yongming added a comment -

        Leif:

        just tested your patch, but looks like we have trouble in function:
        first, it does not works when failover to failover 127.0.0.1, in the following test, I have a working 127.0.0.1 as resolver:
        splitdns.config:
        dest_domain=zymlinux.net named="216.69.185.26;208.109.255.26"
        dest_domain=img01.taobaocdn.com named="127.0.0.1"

        remap.config:
        map http://cdn.zymlinux.net/ http://zymlinux.net/source
        map http://ddn.zymlinux.net/ http://img01.taobaocdn.com/source
        map http://img02.taobaocdn.com/ http://img02.taobaocdn.com/

        records.config:
        CONFIG proxy.config.dns.search_default_domains INT 1
        CONFIG proxy.config.dns.splitDNS.enabled INT 1
        CONFIG proxy.config.dns.splitdns.def_domain STRING NULL
        CONFIG proxy.config.dns.max_dns_in_flight INT 2048
        CONFIG proxy.config.dns.url_expansions STRING NULL
        CONFIG proxy.config.dns.round_robin_nameservers INT 0
        CONFIG proxy.config.dns.nameservers STRING NULL
        CONFIG proxy.config.dns.resolv_conf STRING NULL

        [Nov 17 15:04:01.954] Server

        {47636256498976} DEBUG: (splitdns_config) 216.69.185.26:53
        [Nov 17 15:04:01.954] Server {47636256498976}

        DEBUG: (splitdns_config) 208.109.255.26:53
        [Nov 17 15:04:01.960] Server

        {47636256498976} NOTE: cache clustering disabled
        [Nov 17 15:04:02.016] Server {47636256498976}

        NOTE: logging initialized[7], logging_mode = 3
        [Nov 17 15:04:02.022] Server

        {47636256498976} NOTE: traffic server running
        [Nov 17 15:04:02.022] Server {47636256498976}

        DEBUG: (dns) DNSHandler::startEvent_sdns: on thread 0
        [Nov 17 15:04:02.022] Server

        {47636256498976} DEBUG: (dns) open_con: opening connection 216.69.185.26:53
        [Nov 17 15:04:02.022] Server {47636256498976}

        DEBUG: (dns) random port = 20522
        [Nov 17 15:04:02.022] Server

        {47636256498976} DEBUG: (dns) opening connection 216.69.185.26:53 SUCCEEDED for 0
        [Nov 17 15:04:02.022] Server {47636256498976}

        DEBUG: (dns) DNSHandler::startEvent_sdns: on thread 0
        [Nov 17 15:04:02.022] Server

        {47636256498976} DEBUG: (dns) open_con: opening connection 127.0.0.1:53
        [Nov 17 15:04:02.022] Server {47636256498976}

        DEBUG: (dns) random port = 32628
        [Nov 17 15:04:02.022] Server

        {47636256498976} DEBUG: (dns) opening connection 127.0.0.1:53 SUCCEEDED for 0
        [Nov 17 15:04:02.022] Server {47636256498976}

        DEBUG: (dns) DNSHandler::startEvent_sdns: on thread 0
        [Nov 17 15:04:02.022] Server

        {47636256498976} WARNING: bad '/etc/resolv.conf': no nameservers given
        [Nov 17 15:04:02.022] Server {47636256498976}

        DEBUG: (dns) open_con: opening connection 127.0.0.1:0
        [Nov 17 15:04:02.022] Server

        {47636256498976} DEBUG: (dns) random port = 45432
        [Nov 17 15:04:02.022] Server {47636256498976}

        DEBUG: (dns) opening connection 127.0.0.1:0 SUCCEEDED for 0
        [Nov 17 15:04:02.409] Server

        {47636267030288} NOTE: cache enabled




        [Nov 17 15:04:12.780] Server {47636267030288}

        DEBUG: (splitdns) Called SplitDNS::getDNSRecord(img02.taobaocdn.com)
        [Nov 17 15:04:12.780] Server

        {47636267030288} DEBUG: (splitdns) Failed to match a valid DNS server! Using defaults ...
        [Nov 17 15:04:12.793] Server {47636267030288}

        DEBUG: (dns) received query img02.taobaocdn.com type = 1, timeout = 0
        [Nov 17 15:04:12.794] Server

        {47636267030288} DEBUG: (dns) enqueing query img02.taobaocdn.com
        [Nov 17 15:04:12.794] Server {47636267030288}

        DEBUG: (dns) adding first to collapsing queue
        [Nov 17 15:04:12.794] Server

        {47636267030288} DEBUG: (dns) send query for img02.taobaocdn.com to fd 31
        [Nov 17 15:04:12.795] Server {47636267030288}

        DEBUG: (dns) sent qname = img02.taobaocdn.com, id = 31973, nameserver = 0
        [Nov 17 15:04:12.795] Server

        {47636267030288} DEBUG: (dns) sent_one: failover_number for resolver 0 is 1
        [Nov 17 15:04:12.795] Server {47636256498976} DEBUG: (dns) named error: -111
        [Nov 17 15:04:12.795] Server {47636256498976} DEBUG: (dns) failover: initiating failover attempt, current name_server=0
        [Nov 17 15:04:12.795] Server {47636256498976} WARNING: failover: connection to DNS server 127.0.0.1 lost, retrying
        [Nov 17 15:04:32.797] Server {47636267030288}

        DEBUG: (dns) timeout for query img02.taobaocdn.com
        [Nov 17 15:04:32.797] Server

        {47636267030288} DEBUG: (dns) marking img02.taobaocdn.com as not-written
        [Nov 17 15:04:32.797] Server {47636267030288}

        DEBUG: (dns) doing retry for img02.taobaocdn.com
        [Nov 17 15:04:32.797] Server

        {47636267030288} DEBUG: (dns) send query for img02.taobaocdn.com to fd 31
        [Nov 17 15:04:32.797] Server {47636267030288}

        DEBUG: (dns) sent qname = img02.taobaocdn.com, id = 53119, nameserver = 0
        [Nov 17 15:04:32.797] Server

        {47636267030288} DEBUG: (dns) sent_one: failover_number for resolver 0 is 2
        [Nov 17 15:04:32.797] Server {47636256498976} DEBUG: (dns) named error: -111
        [Nov 17 15:04:32.797] Server {47636256498976} DEBUG: (dns) failover: initiating failover attempt, current name_server=0
        [Nov 17 15:04:32.797] Server {47636256498976} WARNING: failover: connection to DNS server 127.0.0.1 lost, retrying
        [Nov 17 15:04:52.793] Server {47636267030288}

        DEBUG: (dns) timeout for query img02.taobaocdn.com
        [Nov 17 15:04:52.793] Server

        {47636267030288} DEBUG: (dns) marking img02.taobaocdn.com as not-written
        [Nov 17 15:04:52.793] Server {47636267030288}

        DEBUG: (dns) doing retry for img02.taobaocdn.com
        [Nov 17 15:04:52.793] Server

        {47636267030288} DEBUG: (dns) send query for img02.taobaocdn.com to fd 31
        [Nov 17 15:04:52.793] Server {47636267030288}

        DEBUG: (dns) sent qname = img02.taobaocdn.com, id = 24137, nameserver = 0
        [Nov 17 15:04:52.794] Server

        {47636267030288}

        DEBUG: (dns) sent_one: failover_number for resolver 0 is 3
        [Nov 17 15:04:52.794] Server

        {47636256498976} DEBUG: (dns) named error: -111
        [Nov 17 15:04:52.794] Server {47636256498976}

        DEBUG: (dns) failover: initiating failover attempt, current name_server=0
        [Nov 17 15:04:52.794] Server

        {47636256498976}

        WARNING: failover: connection to DNS server 127.0.0.1 lost, retrying

        second:
        if I setup nameserver in records.config, using: CONFIG proxy.config.dns.nameservers, it does not work. just fail to 127.0.0.1.

        besides SplitDNS, the normal DNS still works as expected.

        FYI

        Show
        Zhao Yongming added a comment - Leif: just tested your patch, but looks like we have trouble in function: first, it does not works when failover to failover 127.0.0.1, in the following test, I have a working 127.0.0.1 as resolver: splitdns.config: dest_domain=zymlinux.net named="216.69.185.26;208.109.255.26" dest_domain=img01.taobaocdn.com named="127.0.0.1" remap.config: map http://cdn.zymlinux.net/ http://zymlinux.net/source map http://ddn.zymlinux.net/ http://img01.taobaocdn.com/source map http://img02.taobaocdn.com/ http://img02.taobaocdn.com/ records.config: CONFIG proxy.config.dns.search_default_domains INT 1 CONFIG proxy.config.dns.splitDNS.enabled INT 1 CONFIG proxy.config.dns.splitdns.def_domain STRING NULL CONFIG proxy.config.dns.max_dns_in_flight INT 2048 CONFIG proxy.config.dns.url_expansions STRING NULL CONFIG proxy.config.dns.round_robin_nameservers INT 0 CONFIG proxy.config.dns.nameservers STRING NULL CONFIG proxy.config.dns.resolv_conf STRING NULL [Nov 17 15:04:01.954] Server {47636256498976} DEBUG: (splitdns_config) 216.69.185.26:53 [Nov 17 15:04:01.954] Server {47636256498976} DEBUG: (splitdns_config) 208.109.255.26:53 [Nov 17 15:04:01.960] Server {47636256498976} NOTE: cache clustering disabled [Nov 17 15:04:02.016] Server {47636256498976} NOTE: logging initialized [7] , logging_mode = 3 [Nov 17 15:04:02.022] Server {47636256498976} NOTE: traffic server running [Nov 17 15:04:02.022] Server {47636256498976} DEBUG: (dns) DNSHandler::startEvent_sdns: on thread 0 [Nov 17 15:04:02.022] Server {47636256498976} DEBUG: (dns) open_con: opening connection 216.69.185.26:53 [Nov 17 15:04:02.022] Server {47636256498976} DEBUG: (dns) random port = 20522 [Nov 17 15:04:02.022] Server {47636256498976} DEBUG: (dns) opening connection 216.69.185.26:53 SUCCEEDED for 0 [Nov 17 15:04:02.022] Server {47636256498976} DEBUG: (dns) DNSHandler::startEvent_sdns: on thread 0 [Nov 17 15:04:02.022] Server {47636256498976} DEBUG: (dns) open_con: opening connection 127.0.0.1:53 [Nov 17 15:04:02.022] Server {47636256498976} DEBUG: (dns) random port = 32628 [Nov 17 15:04:02.022] Server {47636256498976} DEBUG: (dns) opening connection 127.0.0.1:53 SUCCEEDED for 0 [Nov 17 15:04:02.022] Server {47636256498976} DEBUG: (dns) DNSHandler::startEvent_sdns: on thread 0 [Nov 17 15:04:02.022] Server {47636256498976} WARNING: bad '/etc/resolv.conf': no nameservers given [Nov 17 15:04:02.022] Server {47636256498976} DEBUG: (dns) open_con: opening connection 127.0.0.1:0 [Nov 17 15:04:02.022] Server {47636256498976} DEBUG: (dns) random port = 45432 [Nov 17 15:04:02.022] Server {47636256498976} DEBUG: (dns) opening connection 127.0.0.1:0 SUCCEEDED for 0 [Nov 17 15:04:02.409] Server {47636267030288} NOTE: cache enabled [Nov 17 15:04:12.780] Server {47636267030288} DEBUG: (splitdns) Called SplitDNS::getDNSRecord(img02.taobaocdn.com) [Nov 17 15:04:12.780] Server {47636267030288} DEBUG: (splitdns) Failed to match a valid DNS server! Using defaults ... [Nov 17 15:04:12.793] Server {47636267030288} DEBUG: (dns) received query img02.taobaocdn.com type = 1, timeout = 0 [Nov 17 15:04:12.794] Server {47636267030288} DEBUG: (dns) enqueing query img02.taobaocdn.com [Nov 17 15:04:12.794] Server {47636267030288} DEBUG: (dns) adding first to collapsing queue [Nov 17 15:04:12.794] Server {47636267030288} DEBUG: (dns) send query for img02.taobaocdn.com to fd 31 [Nov 17 15:04:12.795] Server {47636267030288} DEBUG: (dns) sent qname = img02.taobaocdn.com, id = 31973, nameserver = 0 [Nov 17 15:04:12.795] Server {47636267030288} DEBUG: (dns) sent_one: failover_number for resolver 0 is 1 [Nov 17 15:04:12.795] Server {47636256498976} DEBUG: (dns) named error: -111 [Nov 17 15:04:12.795] Server {47636256498976} DEBUG: (dns) failover: initiating failover attempt, current name_server=0 [Nov 17 15:04:12.795] Server {47636256498976} WARNING: failover: connection to DNS server 127.0.0.1 lost, retrying [Nov 17 15:04:32.797] Server {47636267030288} DEBUG: (dns) timeout for query img02.taobaocdn.com [Nov 17 15:04:32.797] Server {47636267030288} DEBUG: (dns) marking img02.taobaocdn.com as not-written [Nov 17 15:04:32.797] Server {47636267030288} DEBUG: (dns) doing retry for img02.taobaocdn.com [Nov 17 15:04:32.797] Server {47636267030288} DEBUG: (dns) send query for img02.taobaocdn.com to fd 31 [Nov 17 15:04:32.797] Server {47636267030288} DEBUG: (dns) sent qname = img02.taobaocdn.com, id = 53119, nameserver = 0 [Nov 17 15:04:32.797] Server {47636267030288} DEBUG: (dns) sent_one: failover_number for resolver 0 is 2 [Nov 17 15:04:32.797] Server {47636256498976} DEBUG: (dns) named error: -111 [Nov 17 15:04:32.797] Server {47636256498976} DEBUG: (dns) failover: initiating failover attempt, current name_server=0 [Nov 17 15:04:32.797] Server {47636256498976} WARNING: failover: connection to DNS server 127.0.0.1 lost, retrying [Nov 17 15:04:52.793] Server {47636267030288} DEBUG: (dns) timeout for query img02.taobaocdn.com [Nov 17 15:04:52.793] Server {47636267030288} DEBUG: (dns) marking img02.taobaocdn.com as not-written [Nov 17 15:04:52.793] Server {47636267030288} DEBUG: (dns) doing retry for img02.taobaocdn.com [Nov 17 15:04:52.793] Server {47636267030288} DEBUG: (dns) send query for img02.taobaocdn.com to fd 31 [Nov 17 15:04:52.793] Server {47636267030288} DEBUG: (dns) sent qname = img02.taobaocdn.com, id = 24137, nameserver = 0 [Nov 17 15:04:52.794] Server {47636267030288} DEBUG: (dns) sent_one: failover_number for resolver 0 is 3 [Nov 17 15:04:52.794] Server {47636256498976} DEBUG: (dns) named error: -111 [Nov 17 15:04:52.794] Server {47636256498976} DEBUG: (dns) failover: initiating failover attempt, current name_server=0 [Nov 17 15:04:52.794] Server {47636256498976} WARNING: failover: connection to DNS server 127.0.0.1 lost, retrying second: if I setup nameserver in records.config, using: CONFIG proxy.config.dns.nameservers, it does not work. just fail to 127.0.0.1. besides SplitDNS, the normal DNS still works as expected. FYI
        Hide
        mohan_zl added a comment -

        Leif:

        we did some change with splitdns in the following consideration:
        1. we fix TS-435, and leave splitdns as a feature only in dns module
        2. merge your patch with splitdns

        we push a patch in TS-541, you can review it, thanks

        FYI

        Show
        mohan_zl added a comment - Leif: we did some change with splitdns in the following consideration: 1. we fix TS-435 , and leave splitdns as a feature only in dns module 2. merge your patch with splitdns we push a patch in TS-541 , you can review it, thanks FYI

          People

          • Assignee:
            Leif Hedstrom
            Reporter:
            Martin Leventan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development