2

I'm going to explain my question with an example. I have two servers, A and B, both runs Debian 7.8, both have dual-stack connection to the Internet (I don't know if it matters but they even have the same amount of IPv6 addresses) and they both have the same version of whois installed (without any config file).

Now, when I whois google.fr (I chose whois.nic.fr because it shows the IP you're connecting from) from server A, I get this response header:

%%
%% This is the AFNIC Whois server.
%%
%% complete date format : DD/MM/YYYY
%% short date format    : DD/MM
%% version              : FRNIC-2.5
%%
%% Rights restricted by copyright.
%% See http://www.afnic.fr/afnic/web/mentions-legales-whois_en
%%
%% Use '-h' option to obtain more information about this service.
%%
%% [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx REQUEST] >> -V Md5.1 google.fr
%%
%% RL Net [##########] - RL IP [#########.]
%%

As you can see, whois used a IPv6 address to connect to whois.nic.fr.

But, when I do the same at server B, I get this response header:

%%
%% This is the AFNIC Whois server.
%%
%% complete date format : DD/MM/YYYY
%% short date format    : DD/MM
%% version              : FRNIC-2.5
%%
%% Rights restricted by copyright.
%% See http://www.afnic.fr/afnic/web/mentions-legales-whois_en
%%
%% Use '-h' option to obtain more information about this service.
%%
%% [xx.x.xxx.xxx REQUEST] >> -V Md5.1 google.fr
%%
%% RL Net [##########] - RL IP [#########.]
%%

As you can see now, whois used IPv4 at server B.

Why doesn't server B use IPv6 when connecting to the whois server? They surely both have connection with IPv6 but one of them chooses to use IPv6 where one does not. Is there any reason for the OS to prioritize connection types?

1

Turns out that it's about configuration of getaddrinfo, which is controlled at /etc/gai.conf.

More information about how it can be solved: https://askubuntu.com/questions/32298/prefer-a-ipv4-dns-lookups-before-aaaaipv6-lookups

0

It's not the OS but the application that makes the connection. If whois wants to connect to n IPv6 address, then the OS will determine what (IPv6) source address is used for the connection, unless the application has bound the source address explicitly. When connecting to an IPv4 address an IPv4 address is used as the source. You can't use an IPv6 source address to connect to an IPv4 destination address and vice versa.

Now the question becomes: why does whois choose to connect to whois.nic.fr's IPv6 address on the one server, and to the IPv4 address on the other. You'd have to run strace with both servers to see what the differences are, perhaps resolving the AAAA address on the one server timed out and the subsequent A lookup succeeded.

  • Hmmm, no, not really. In practicec, it's usually the DNS response that makes the difference (assuming the application supports both), and that's strongly influence by the OS configuration. – Gilles Apr 29 '15 at 21:58
  • Both servers can reach whois.nic.fr via IPv4/IPv6 without any problems. And this made me think that an OS configuration prioritizing something and whois can't use IPv6. – Hasan Berkay Cagir Apr 30 '15 at 4:42
  • @Gilles I basically said that the DNS could be the deciding factor. However I wouldn't know how to configure the OS to allow AAAA queries or not, hence my suggestion that a timeout might have occurred. – wurtel Apr 30 '15 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.