Discussion:
Disabling AAAA dns lookups in NetBSD
(too old to reply)
David Brownlee
2013-08-26 09:03:10 UTC
Permalink
I've seen this (or similar) asked before, but the only answer I've
seen is "rewrite the application to handle IPv6 connection failure and
retry with IPv4", which is a very laudable goal, but not suitable for
all cases.

I'm attempting to use a perl script which calls Mail::IMAPClient to
connect to google (which has both IPv4 and IPv6). Obviously NetBSD
picks up the IPv6 address first, and then fails with "No route to
host".

Tools that ship with the system understand how to handle this, but is
it reasonable for every third party tool to have to do so?

Based on previous comments I've tried setting "ip6mode=off" in rc.conf
without any apparent affect.

Short of compiling a custom kernel, how would I do one of the following?
- disable AAAA lookup
- prefer A lookup to AAAA
- disable all IPv6 activity on the system

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Takahiro Kambe
2013-08-26 09:07:09 UTC
Permalink
In message <CAGN_6pae4eeio5AB+mQ=4B93u+Ytkg0vQVrKaf4VJxZPZ-***@mail.gmail.com>
on Mon, 26 Aug 2013 10:03:10 +0100,
Post by David Brownlee
I've seen this (or similar) asked before, but the only answer I've
seen is "rewrite the application to handle IPv6 connection failure and
retry with IPv4", which is a very laudable goal, but not suitable for
all cases.
We need ip6addrctl(8) on FreeBSD.
--
Takahiro Kambe <***@back-street.net>

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Gert Doering
2013-08-26 09:22:12 UTC
Permalink
Hi,
Post by David Brownlee
Tools that ship with the system understand how to handle this, but is
it reasonable for every third party tool to have to do so?
Yes. IPv4+IPv6 mixed mode is going to stay with us for a long time, and
"one protocol broken, one protocol working" will happen quite often.

Applications claiming IPv6 support that can not fail-over from one family
to the other if whatever they try first are just broken.

(Even if the local system has perfectly working IPv6, there might be
issues on the path to the target server, while IPv4 could succeed - or
vice versa)

gert
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany ***@greenie.muc.de
fax: +49-89-35655025 ***@net.informatik.tu-muenchen.de

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Lloyd Parkes
2013-08-26 09:29:11 UTC
Permalink
Post by David Brownlee
I'm attempting to use a perl script which calls Mail::IMAPClient to
connect to google (which has both IPv4 and IPv6). Obviously NetBSD
picks up the IPv6 address first, and then fails with "No route to
host".
...
Short of compiling a custom kernel, how would I do one of the following?
- disable AAAA lookup
- prefer A lookup to AAAA
- disable all IPv6 activity on the system
You could also fix Mail::IMAPClient so that it does the right thing. It is almost certainly using a library call that returns a list of IP addresses and the code just needs adjusting to try each IP address until a successful connection is made. That's what I make my programs do and it is the modern way of using gethostbyname(3) (in as much as using gethostbyname(3) could be said to be modern).

Cheers,
Lloyd


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Brownlee
2013-08-26 09:35:11 UTC
Permalink
Post by Lloyd Parkes
Post by David Brownlee
I'm attempting to use a perl script which calls Mail::IMAPClient to
connect to google (which has both IPv4 and IPv6). Obviously NetBSD
picks up the IPv6 address first, and then fails with "No route to
host".
...
Short of compiling a custom kernel, how would I do one of the following?
- disable AAAA lookup
- prefer A lookup to AAAA
- disable all IPv6 activity on the system
You could also fix Mail::IMAPClient so that it does the right thing. It is almost certainly using a library call that returns a list of IP addresses and the code just needs adjusting to try each IP address until a successful connection is made. That's what I make my programs do and it is the modern way of using gethostbyname(3) (in as much as using gethostbyname(3) could be said to be modern).
OK, so I'll take a look at fixing Mail::IMAPClient. Would someone like
to take a look at subversion - which has similar issues...

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Lloyd Parkes
2013-08-26 09:45:05 UTC
Permalink
Post by David Brownlee
Post by Lloyd Parkes
Post by David Brownlee
I'm attempting to use a perl script which calls Mail::IMAPClient to
connect to google (which has both IPv4 and IPv6). Obviously NetBSD
picks up the IPv6 address first, and then fails with "No route to
host".
...
Short of compiling a custom kernel, how would I do one of the following?
- disable AAAA lookup
- prefer A lookup to AAAA
- disable all IPv6 activity on the system
You could also fix Mail::IMAPClient so that it does the right thing. It is almost certainly using a library call that returns a list of IP addresses and the code just needs adjusting to try each IP address until a successful connection is made. That's what I make my programs do and it is the modern way of using gethostbyname(3) (in as much as using gethostbyname(3) could be said to be modern).
OK, so I'll take a look at fixing Mail::IMAPClient. Would someone like
to take a look at subversion - which has similar issues...
I was having a quick look at it and it seems to be that the IMAPClient isn't passing MultiHomed=>1 to IO::Socket::INET->new().

Cheers,
Lloyd


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Brownlee
2013-08-26 09:50:46 UTC
Permalink
Heh, I sent an email with the same suggestion back to the author about
two minutes ago :)

Will be committing a patch to pkgsrc shortly...
Post by Lloyd Parkes
Post by David Brownlee
Post by Lloyd Parkes
Post by David Brownlee
I'm attempting to use a perl script which calls Mail::IMAPClient to
connect to google (which has both IPv4 and IPv6). Obviously NetBSD
picks up the IPv6 address first, and then fails with "No route to
host".
...
Short of compiling a custom kernel, how would I do one of the following?
- disable AAAA lookup
- prefer A lookup to AAAA
- disable all IPv6 activity on the system
You could also fix Mail::IMAPClient so that it does the right thing. It is almost certainly using a library call that returns a list of IP addresses and the code just needs adjusting to try each IP address until a successful connection is made. That's what I make my programs do and it is the modern way of using gethostbyname(3) (in as much as using gethostbyname(3) could be said to be modern).
OK, so I'll take a look at fixing Mail::IMAPClient. Would someone like
to take a look at subversion - which has similar issues...
I was having a quick look at it and it seems to be that the IMAPClient isn't passing MultiHomed=>1 to IO::Socket::INET->new().
Cheers,
Lloyd
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...