tokers commented on a change in pull request #3129:
URL: https://github.com/apache/apisix/pull/3129#discussion_r550748424



##########
File path: apisix/core/utils.lua
##########
@@ -80,26 +82,16 @@ function _M.split_uri(uri)
 end
 
 
-local function dns_parse(domain, resolvers)
-    resolvers = resolvers or _M.resolvers
-    local r, err = resolver:new{
-        nameservers = table.clone(resolvers),
-        retrans = 5,  -- 5 retransmissions on receive timeout
-        timeout = 2000,  -- 2 sec
-    }
-
-    if not r then
-        return nil, "failed to instantiate the resolver: " .. err
+local function dns_parse(domain)
+    if not dns_proxy.inited then
+        dns_proxy.client.init()
     end
 
-    local answers, err = r:query(domain, nil, {})
-    if not answers then
-        return nil, "failed to query the DNS server: " .. err
-    end
+    local answers, err
+    answers, err = dns_proxy.client.resolve(domain)
 
-    if answers.errcode then
-        return nil, "server returned error code: " .. answers.errcode
-                    .. ": " .. answers.errstr
+    if not answers then
+      return nil, "failed to query the DNS server: " .. err

Review comment:
       Style: bad indent, should keep 4 spaces.




----------------------------------------------------------------
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]


Reply via email to