Skip to content

Question: Is it possible to change the DNS resolution timeout in the configuration file? #13082

@jburgoos

Description

@jburgoos

Description

For our system, we are using the DNS resolver provided by APISIX. To do this, we configured the following in the configuration file:

apisix:
  node_listen:
    - ip: X.X.X.X
      port: 10080
  enable_ipv6: false
  dns_resolver:
    - "x.x.x.x"
    - "y.y.y.y"
  dns_resolver_valid: 30
  resolver_timeout: 1

With this configuration, we expected the DNS query timeout to be 1 second. However, it seems that regardless of the value we set, we still observe a DNS timeout of 2 seconds.

It appears that this setting configures the NGINX instance associated with the service, but the DNS resolution is performed earlier within APISIX itself.

While investigating the root cause, we found that the DNS resolution timeout seems to be hardcoded in the source code at the highlighted line (client.lua):

Image

After testing by changing that value (from 2000 to 1000) and running systemctl reload apisix, we observed that the DNS resolution timeout then becomes 1 second, which is what we expected.

Is there any way to configure this timeout without modifying the source code? If not, is there any plan to make these values configurable in the future?

Environment

  • APISIX version (run apisix version): 3.8.0
  • Operating system (run uname -a): debian 11
  • OpenResty / Nginx version (run openresty -V or nginx -V): openresty/1.21.4.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionlabel for questions asked by users

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions