de1o opened a new issue #1404: bug: maybe apisix should look for an A record 
in dns query result instead of get random one
URL: https://github.com/apache/incubator-apisix/issues/1404
 
 
   ### Issue description
   now in apisix.core.utils.dns_parse method, the code choose a random one from 
dns query result.
   when the dns record is a CNAME record, dns query may get result like 
   ```
   
[{"cname":"cname.xxx.com","class":1,"ttl":600,"name":"server.xxx.com","section":1,"type":5},
   
{"address":"10.9.1.1","class":1,"ttl":600,"name":"cname.xxx.com","section":1,"type":1}]
   ```
   in this case, user expect to get the A record of domain server.xxx.com, 
while apisix will return random result, which may cause upstream/routes get 
empty nodes.
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): current master
   * OS: any
   
   ### Minimal test code / Steps to reproduce the issue
   1.config a domain in upstream, the domain's dns record set to a CNAME record.
   2.request the route configed with the domain
   
   ### What's the actual result? (including assertion message & call stack if 
applicable)
   request will fail randomly depend on the code in dns_parse
   
   ### What's the expected result?
   requests always work fine with CNAME record domains.
   apisix should do a loop in dns query result to find a A record, or filter 
all the CNAME record then find a random A record?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to