kleinhenz@mklein-nb:~$ host x.blubb.blubb
x.blubb.blubb has address 172.16.4.2
x.blubb.blubb has address 172.16.4.1
x.blubb.blubb has address 172.16.4.3
Applications usually use the first entry, resulting in a per-query association of host and ip address. If the actual DNS query is not cached, it works as a continuing distribution of querys over the listed ips.
Turning off the DNS caching in Java is easy: set the "networkaddress.cache.ttl" property to "0" disables it. But here comes the problem: if you have mixed IPv4 and IPv6 hosts in your DNS, Java will prefer the v6 hosts, listing them on top on the v4 addresses. This results in a bizarre behaviour: the list of ips in the returned list are mixed up - but in two groups: the mixed IPv6 host group appears on top of the mixed IPv6 group!
The solution is rather simple: just add "java.net.preferIPv4Stack=true" to the properties environment and the round robin works as espected.
Keine Kommentare:
Kommentar veröffentlichen