Opened 5 years ago

Closed 5 years ago

#1837 closed defect (invalid)

nginx resolver failed when ipv6 AAAA dns query failed and ipv4 A query success

Reported by: crasyangel.lhy@… Owned by:
Priority: critical Milestone: nginx-1.17
Component: nginx-core Version: 1.16.x
Keywords: resolver AAAA A ipv6 failed Cc: gcc, 4.8.2
uname -a: Linux 3.10.0_3-0-0-15 #1 SMP Fri Jan 12 18:18:11 CST 2018 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.16.1
built by gcc 4.8.2 (GCC)
configure arguments:



worker_processes  1;
daemon on;
error_log /home/work/code/gy/jnx/t/servroot/logs/error.log debug;
pid       /home/work/code/gy/jnx/t/servroot/logs/;

http {
    access_log /home/work/code/gy/jnx/t/servroot/logs/access.log;

    server {
        listen          1984;
        resolver ;
        location /t {
           set $backend "";
           proxy_pass http://$backend;

events {
    accept_mutex off;
    worker_connections  64;

tcpdump output like

342 05:15:29.309179 DNS 73  Standard query 0x5ed7 A
343 05:15:29.309236 DNS 73  Standard query 0x4c22 AAAA
351 05:15:29.332931   DNS 89  Standard query response 0x5ed7 A A
369 05:15:29.511221   DNS 73  Standard query response 0x4c22 Server failure AAAA

Ipv4 A query succeed first, but resolver would try next, and ipv6 AAAA query failed, then code != 0, it was NGX_RESOLVE_SERVFAIL in this way. And woke callback with ctx->state failed

Should it goto export when rn->naddrs > 0 when ipv6 failed?

Change History (1)

comment:1 by Sergey Kandaurov, 5 years ago

Resolution: invalid
Status: newclosed

It won't because AAAA query failed.
If there are no AAAA records - your DNS server is expected to return empty response with no error set. See for details.
If you cannot fix the DNS server, the ipv6=off parameter can be specified.

Note: See TracTickets for help on using tickets.