-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't disable IPv6 (AAAA record) #12
Comments
I compiled with --with-ipv6
and here is part of the config
I started tcpdump watching port 53 before starting nginx. I can see that nginx will first use local /etc/resolv.conf name servers to query A of www.yahoo.com and AAAA of www.yahoo.com. I assume both IPv4/IPv6 results will be stored in nginx for upstream access. |
@gfrankliu are you sure that it still using the ipv6 record after you set it to off?
when I changed it to on
Please test it again without using any other module, including nginx_upstream_check_module. |
See my ./configure command above, I didn't enable any other modules. Later DNS queries seem to function properly as you discovered (using name servers from "resolver" and only queries A record). |
If I have a special DNS server for nginx which I define using "resolver", the normal name servers from /etc/resolv.conf may not even be able to resolve the upstream name. What will nginx do? Is there a way we can stop nginx from using /etc/resolv.conf for this module? |
Hi @gfrankliu |
During my test, I saw once the first DNS query got the AAAA record and added to upstream pool, along with the A record, it never got removed by subsequent DNS queries . I guess since the later DNS queries only got A records so only they got updated. AAAA address was left alone. |
@gfrankliu
To avoid use the first AAAA entry we must do custom DNS query functions or to set the server as down until de "resolver" get an answer for the server. |
The first DNS happened probably because we used "server" directive that triggered nginx default dns lookup behavior. Maybe we should use a new directive like what jdomain does. In my test, I saw the second DNS query only updated the IPv4 addresses of the upstream configuration but left IPv6 alone, maybe because the second query didn't get any IPv6 addresses since we disabled IPv6. |
@gfrankliu we don't use the default "server" directive, the name is the same but the implementation not. |
See my last comment in #13 , it seems the AAAA response from the first dns query got stuck in the upstream list even though the second dns didn't get AAAA record. This causes nginx worker crashes even after the second dns query. |
@gfrankliu please, do not mix the issues. The actual crash on #13 is a problem with another 3rd party module (see my comment). |
problem still exist, how to fix it? ipv6=off not helped, nginx reequest ip6 address |
I set the ipv6=off to the resolver as documented here:
http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver
but it seems you are still getting both A (IPv4) and AAAA (IPv6) records from DNS resolver.
The text was updated successfully, but these errors were encountered: