We have a step during in of our large map reduce that does DNS resolutions. The application itself uses the c-ares library as well as libcurl.
I notice that with each resolution, there is first an AAAA attempt, then immediately an A resolution. This is seen clearly with TCPdump both on our named server as well as on the host.
Here's a sample of traffic to S3
$ tcpdump dst port 53 20:28:35.259552 IP x.x.x.x.55271 > ec2-xx.amazonaws.com.domain: 21815+ AAAA? s3.amazonaws.com. (34) 20:28:35.261526 IP x.x.x.x.56058 > ec2-xx.amazonaws.com.domain: 21823+ A? s3.amazonaws.com. (34)
And it repeats for each resolution. Since we do more than 70 million resolutions during this process, it makes sense to want to cut out 50% of this as waste.
How can I disable IPv6 lookups in Ubuntu?
I've tried changing the precedence in /etc/gai.conf to:
precedence ::ffff:0:0/96 45
Yet I am still seeing ubuntu first try IPv6 resolutions. Any help would be greatly appreciated
My /etc/resolv.conf is simple with just a nameserver set:
cat /etc/resolv.conf nameserver x.x.x.x