[ 
https://issues.apache.org/jira/browse/TS-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932856#action_12932856
 ] 

Zhao Yongming commented on TS-435:
----------------------------------

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


> SplitDNS doesn't work
> ---------------------
>
>                 Key: TS-435
>                 URL: https://issues.apache.org/jira/browse/TS-435
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: DNS
>    Affects Versions: 2.0.1
>         Environment: Debian 5.0.5 kernel  2.6.26-1-686 #1 SMP
>            Reporter: Martin Leventan
>            Assignee: Leif Hedstrom
>            Priority: Trivial
>             Fix For: 2.1.5
>
>         Attachments: TS-435-3.diff, TS-435.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to