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:

Description

nginx.conf

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/nginx.pid;

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

    server {
        listen          1984;
        resolver 114.114.114.114 ;
        location /t {
           set $backend "btts.qq.com/getbacksource";
           proxy_pass http://$backend;
        }
    }
}

events {
    accept_mutex off;
    worker_connections  64;
}

tcpdump output like

342 05:15:29.309179 10.100.124.92   114.114.114.114 DNS 73  Standard query 0x5ed7 A btts.qq.com
343 05:15:29.309236 10.100.124.92   114.114.114.114 DNS 73  Standard query 0x4c22 AAAA btts.qq.com
351 05:15:29.332931 114.114.114.114 10.100.124.92   DNS 89  Standard query response 0x5ed7 A btts.qq.com A 183.61.51.41
369 05:15:29.511221 114.114.114.114 10.100.124.92   DNS 73  Standard query response 0x4c22 Server failure AAAA btts.qq.com

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 https://tools.ietf.org/html/rfc4074#section-3 for details.
If you cannot fix the DNS server, the ipv6=off parameter can be specified.

Note: See TracTickets for help on using tickets.