From cb4b5fd143c0c022af45d3d3f5c4d2544b354b8f Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Wed, 29 Jun 2016 06:55:44 +0100 Subject: [PATCH] correct RFC3484 address selection caveat and move it to a more prominent location Fixes #1710 --- site/weavedns/how-works-weavedns.md | 12 ------------ site/weavedns/load-balance-fault-weavedns.md | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/site/weavedns/how-works-weavedns.md b/site/weavedns/how-works-weavedns.md index 52b4e77d..118ec368 100644 --- a/site/weavedns/how-works-weavedns.md +++ b/site/weavedns/how-works-weavedns.md @@ -17,18 +17,6 @@ When weaveDNS is queried for a name in the `.weave.local` domain, it looks up the hostname in its memory database and responds with the IPs of all containers for that hostname across the entire cluster. -###Basic Load Balancing and Fault Tolerance - -WeaveDNS returns IP addresses in random order to facilitate basic -load balancing and failure tolerance. Most client side resolvers sort -the returned addresses based on reachability, and place local addresses -at the top of the list (see [RFC 3484](https://www.ietf.org/rfc/rfc3484.txt)). - -For example, if there is container with the desired hostname on the local -machine, the application receives that container's IP address. -Otherwise, the application receives the IP address of a random -container with the desired hostname. - When weaveDNS is queried for a name in a domain other than `.weave.local`, it queries the host's configured nameserver, which is the standard behaviour for Docker containers. diff --git a/site/weavedns/load-balance-fault-weavedns.md b/site/weavedns/load-balance-fault-weavedns.md index 45e98c15..12fb1204 100644 --- a/site/weavedns/load-balance-fault-weavedns.md +++ b/site/weavedns/load-balance-fault-weavedns.md @@ -33,6 +33,14 @@ PING pingme.weave.local (10.32.0.2) 56(84) bytes of data. Notice how the ping reaches different addresses. +However, due to +[RFC 3484 address selection](https://tools.ietf.org/html/rfc3484#section-6) +most DNS resolver libraries prefer certain addresses over others, to +the point where in some circumstances the same address is always +chosen. To avoid this behaviour, applications may want to perform +their own address selection, e.g. by choosing a random entry from the +result of +[`getaddrinfo()`](http://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html). ## Fault Resilience