Ubuntu 12.04 - problem with name resolution - IPv6 queries are sent before IPv4.

Rafał Radecki radecki.rafal at gmail.com
Wed Apr 29 08:06:31 UTC 2015


My remarks below ;)

2015-04-28 0:19 GMT+02:00 Karl Auer <kauer at biplane.com.au>:

> On Mon, 2015-04-27 at 15:50 +0200, Rafał Radecki wrote:
> > I have a quite annoying problem on several ubuntu 12.04 servers. When I
> > force a dns query using:
> >
> > time wget --waitretry=1 http://xxx.yyy -O -
>
> The best way to avoid attempting to connect via IPv6 is to stop the
> particular application using IPv6. In the case of wget, try the "-4" or
> "--inet4-only" options. You could also use the "--prefer-family=IPv4"
> option.


For wget it is very easy. But the problem is that we are running node.js
applications and they are just performing some dns queries. If IPv6 is
disabled in the operatin system from my point of view no DNS AAAA queries
should be send to the DNS server as a result of application queries.


>
> > I get (tcpdump & wireshark) the info that an AAAA IPv6 query is first
> send
> > to a DNS server from /etc/resolv.conf. The server is only serving IPv4
> > queries so it responds with an error. Then an IPv4 query is sent. Overall
> > the process takes ~10 seconds every time so its painful.
>
> The "IPv6 then IPv4" lookup is normal. Taking 10 seconds to fail a
> lookup is not normal. 10 seconds is a very strange delay - too short to
> be most things and too long to be most other things :-) Where exactly is
> the delay?

DNS server is replying after mentioned ~10s with a broken reply for the
IPv6 AAAA query. And then the operating system is sending a IPv4 A query
which is responded correctly.

>
> > I tried to disable IPv6 by:
>
> Almost always the wrong approach.

Why? I do not use IPv6 and do not plan to use it in any way. Once I disable
it I do not have to create a firewall for it and worry about any possible
malicious IPv6 traffic.

>


> > and then I run update-grub an performed a restart. The server is not
> using
> > IPv6 anymore BUT the IPv6 queries are still performed before IPv4 queries
> > for each dns lookup which I perform with wget/curl or from inside my
> > node.js application. From my point of view it is quite strange :D I
> > disabled IPv6 and still see IPv6 queries :D
>
> Not strange - that's DNS doing lookups, and DNS works on either
> protocol. The protocol used to make a query or deliver a response is
> completely independent of the content of the query or the content of the
> response. Without IPv6 available, the queries will be sent and received
> via IPv4 - but the queries and responses may contain IPv6 information.
>
You say that "Without IPv6 available, the queries will be sent and received
via IPv4". This seems not the case here. IPv6 is disabled in the operating
system, node.js application performs a query and the operating system first
sends an AAAA IPv6 query regardless.

>
> Regards, K.
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Karl Auer (kauer at biplane.com.au)
> http://www.biplane.com.au/kauer
> http://twitter.com/kauer389
>
> GPG fingerprint: 3C41 82BE A9E7 99A1 B931 5AE7 7638 0147 2C3C 2AC4
> Old fingerprint: EC67 61E2 C2F6 EB55 884B E129 072B 0AF0 72AA 9882
>
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20150429/bd893c5d/attachment.html>


More information about the ubuntu-users mailing list