OpenWrt Forum Archive

Topic: resolver making AAAA IPv6 over A IPv4 dns queries

The content of this topic has been archived on 4 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi

I have recently built a trunk image. I ran into a problem with name resolution, it seems the system is setup to make AAAA requests before A requests.


to test run this

tcpdump -pni <your interface that dns queries go out of> port 53 &

ping -c 1 google.com

when I do this I see that a AAAA request is made first and then a A request >

I know how to do this on a debian box inet6 in resolv.conf. but I am not sure how to set up ipv4 over ipv6.

Can somebody please try this on their machine, 2.6 7.09

Thanks

====

Posted this to the wrong group, reposting in kamikaze....

====

I have done some checking out and uClibc  has this statement from getaddrinfo.c, the records are tried in order

static struct gaih gaih[] =
{
#if __UCLIBC_HAS_IPV6__
    { PF_INET6, gaih_inet },
#endif
    { PF_INET, gaih_inet },
#if 0
    { PF_LOCAL, gaih_local },
#endif
    { PF_UNSPEC, NULL }
};

Note thay uclibc is built with __UCLIBC_HAS_IPV6__, this is the order that dns enquiries are made when no protocol is requested.  make a ipv6 request first and then a ipv4 request. This is not the way a x86/linux(glibc) system would do it, the default is to do the ipv4 first and then the ipv6 - set by a flag usually in resolv.conf

You don't need ipv6 to resolve AAAA hosts, however, the software should ignore the AAAA results if there is no ipv6 path - this is normal.

Cisien wrote:

You don't need ipv6 to resolve AAAA hosts, however, the software should ignore the AAAA results if there is no ipv6 path - this is normal.

Yep understand this, my problem is I had a domain with partial ipv6 and full ipv4 coverage.  my openwrt router was prioritising ipv6 addresses above ipv4, haven't seen this on my other linux box.  when I checked the code it has been hard coded for that.

for example on my linux box when I make a request for google.com, it sends a request to my name server firstly for A records and then if not found AAAA records. on openwrt and with uClibc (configured with ipv6 support) it requests first for AAAAA records and then A records, even from a box that has only an ipv4 address.

from my experience, mostly with firefox, if my ipv6 tunnel is down, a web page will take a few seconds to timeout the ipv6 connection, and then fall back to ipv4. It was like this when my tunnel terminated at a linux router (computer), and an openwrt router. but yes, the ability to change this would be good.

The discussion might have continued from here.