DNS Director with hostname resolving to multiple IPs

jonathan.huot at thomsonreuters.com jonathan.huot at thomsonreuters.com
Tue Aug 27 15:39:50 CEST 2013

Have you tried with a correct example of DNS director ?

e.g. from The Varnish Reference Manual<https://www.varnish-cache.org/docs/3.0/reference/vcl.html#the-dns-director> :

director directorname dns {
        .list = {
                .host_header = "www.example.com";
                .port = "80";
                .connect_timeout = 0.4s;
        .ttl = 5m;
        .suffix = "internal.example.net";

Varnish need to know in advance the range of IPs, else, it will not be working.
I think latest version of Varnish will improve this kind of ability by implementing lazy backend creation. But I’m not sure if it’s stable enough to be used.

Jonathan Huot
Phone: +33(0)

From: varnish-bugs-bounces+jonathan.huot=thomsonreuters.com at varnish-cache.org [mailto:varnish-bugs-bounces+jonathan.huot=thomsonreuters.com at varnish-cache.org] On Behalf Of Tim Harrison
Sent: Thursday, 22 August 2013 08:11 PM
To: varnish-bugs at varnish-cache.org
Subject: DNS Director with hostname resolving to multiple IPs


The Varnish Reference Manual<https://www.varnish-cache.org/docs/3.0/reference/vcl.html#the-dns-director> suggests that the DNS director can be used with a hostname that resolves to multiple IP addresses,

“DNS round robin balancing is supported. If a hostname resolves to multiple backends, the director will divide the traffic between all of them in a round-robin manner.”

And I believe the following is the correct VCL to implement this,

director test dns {
           .backend = {
                .host = "hostname.with.multiple.ips";
     .ttl = 10s;

However, on compilation Varnish complains,

Backend host "hostname.with.multiple.ips": resolves to multiple IPv4 addresses.
Only one address is allowed.
Please specify which exact address you want to use, we found these:

Having looked at the source code in vcc_dir_dns.c and vcc_backend.c, it seems that the hostname associated with a .host object can never resolve to more than one IP address, so it’s not clear how the functionality described in the Reference Manual can be achieved.

I think this may be a bug, can you help please?

Many thanks,

Tim Harrison


This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.


This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-bugs/attachments/20130827/95832b51/attachment.html>

More information about the varnish-bugs mailing list