<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.b5106d6a-14db-4c5e-b594-6a7a4117503b, li.b5106d6a-14db-4c5e-b594-6a7a4117503b, div.b5106d6a-14db-4c5e-b594-6a7a4117503b
        {mso-style-name:b5106d6a-14db-4c5e-b594-6a7a4117503b;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.il
        {mso-style-name:il;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Have you tried with a correct example of DNS director ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">e.g. from </span><span lang="EN-GB">The
<a href="https://www.varnish-cache.org/docs/3.0/reference/vcl.html#the-dns-director">
Varnish Reference Manual</a> :</span><span lang="EN-US" style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div style="mso-element:para-border-div;border-top:solid #AACC99 1.0pt;border-left:none;border-bottom:solid #AACC99 1.0pt;border-right:none;padding:4.0pt 0cm 4.0pt 0cm;background:#EEFFCC">
<p class="MsoNormal" style="line-height:11.25pt;background:#EEFFCC;border:none;padding:0cm">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#222222;mso-fareast-language:FR">director directorname dns {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:#EEFFCC;border:none;padding:0cm">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#222222;mso-fareast-language:FR">        .list = {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:#EEFFCC;border:none;padding:0cm">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#222222;mso-fareast-language:FR">                .host_header = "www.example.com";<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:#EEFFCC;border:none;padding:0cm">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#222222;mso-fareast-language:FR">                .port = "80";<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:#EEFFCC;border:none;padding:0cm">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#222222;mso-fareast-language:FR">                .connect_timeout = 0.4s;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:#EEFFCC;border:none;padding:0cm">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#222222;mso-fareast-language:FR">                "192.168.15.0"/24;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:#EEFFCC;border:none;padding:0cm">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#222222;mso-fareast-language:FR">                "192.168.16.128"/25;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:#EEFFCC;border:none;padding:0cm">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#222222;mso-fareast-language:FR">        }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:#EEFFCC;border:none;padding:0cm">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#222222;mso-fareast-language:FR">        .ttl = 5m;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:#EEFFCC;border:none;padding:0cm">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#222222;mso-fareast-language:FR">       
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#222222;mso-fareast-language:FR">.suffix = "internal.example.net";<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:11.25pt;background:#EEFFCC;border:none;padding:0cm">
<span style="font-size:10.0pt;font-family:"Courier New";color:#222222;mso-fareast-language:FR">}<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Varnish need to know in advance the range of IPs, else, it will not be working.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666;mso-fareast-language:FR">Jonathan Huot<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666;mso-fareast-language:FR">Phone: +33(0)1.47.62.78.65<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:FR">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:FR"> varnish-bugs-bounces+jonathan.huot=thomsonreuters.com@varnish-cache.org
 [mailto:varnish-bugs-bounces+jonathan.huot=thomsonreuters.com@varnish-cache.org]
<b>On Behalf Of </b>Tim Harrison<br>
<b>Sent:</b> Thursday, 22 August 2013 08:11 PM<br>
<b>To:</b> varnish-bugs@varnish-cache.org<br>
<b>Subject:</b> DNS Director with hostname resolving to multiple IPs<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-GB">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">The <a href="https://www.varnish-cache.org/docs/3.0/reference/vcl.html#the-dns-director">
Varnish Reference Manual</a> suggests that the DNS director can be used with a hostname that resolves to multiple IP addresses,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><i><span lang="EN-GB">“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.”<o:p></o:p></span></i></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">And I believe the following is the correct VCL to implement this,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">director test dns {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">     {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">           .backend = {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">                .host = "hostname.with.multiple.ips";<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">           }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">     }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">     .ttl = 10s;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">However, on compilation Varnish complains,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">Backend host "hostname.with.multiple.ips": resolves to multiple IPv4 addresses.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">Only one address is allowed.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">Please specify which exact address you want to use, we found these:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">        xxx.xxx.xxx.xxx<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New"">        xxx.xxx.xxx.xxx<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Having looked at the source code in vcc_dir_dns.c and vcc_backend.c, it seems that the hostname associated with a
</span><span lang="EN-GB" style="font-family:"Courier New"">.host</span><span lang="EN-GB"> 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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">I think this may be a bug, can you help please?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Many thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-GB">Tim Harrison</span><span lang="EN-GB"><o:p></o:p></span></p>
<p class="b5106d6a-14db-4c5e-b594-6a7a4117503b"><span lang="EN-GB"> <o:p></o:p></span></p>
<p class="b5106d6a-14db-4c5e-b594-6a7a4117503b"><span lang="EN-GB">----------------------------<br>
<br>
<a href="http://www.bbc.co.uk" target="_blank">http://www.<span class="il">bbc</span>.<span class="il">co</span>.<span class="il">uk</span></a><br>
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the
<span class="il">BBC</span> unless specifically stated.<br>
If you have received it in error, please delete it from your system.<br>
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.<br>
Please note that the <span class="il">BBC</span> monitors e-mails sent or received.<br>
Further communication will signify your consent to this.<o:p></o:p></span></p>
<p class="b5106d6a-14db-4c5e-b594-6a7a4117503b"><span lang="EN-GB">---------------------<o:p></o:p></span></p>
</div>
 <br>
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.</body>
</html>