<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Latha;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
<style type="text/css">.style1 {font-family: "Times New Roman";}</style></head><body lang="EN-IN" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoPlainText"><span lang="EN-US">Hello:<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">I am working on replacing libcares with unbound for my client on an OpenWrt platform. I am using async mode ( ub_resolve_async() ) for DNS queries and unbound is used as a forwarding server and
not authoritative one. serve-expired is left at default which is 'no..<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">The issue I am facing is the application that uses unbound maintains its own cache and on expiry of ttl re-queries unbound which immediately returns an answer with ttl=0 and then sends a fresh query
out. This is not desirable for our application. If the application re-queries after tt+1 second then unbound returns answer from fresh query instead serving expired with ttl=0.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">1. Why does unbound return expired record with ttl=0 when serve-expired is left at default which is 'no.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">2. Why does unbound always sends out new query only after 1 sec after ttl expiry instead of immediately sending new query?
<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">Very First Query<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">Application ---> Query -----------------> Unbound<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"> Unbound ---> Query ---> Authoritative DNS Server
<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"> Unbound <--- Answer (ttl = t) <--- Authoritative DNS Server<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">Application <--- Answer (ttl = t) < ----------Unbound<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"> <o:p>
</o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">After ttl t secs expiry, Second Query
<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">Application ---> Query -----------------> Unbound<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">Application <--- Answer (ttl = 0) < ---------Unbound. (<b>NOT DESIRABLE</b>)<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"> Unbound 1 sec wait (<b>NOT DESIRABLE</b>)<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"> Unbound ---> Query ---> Authoritative DNS Server
<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"> Unbound <--- Answer (ttl = t) <--- Authoritative DNS Server<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">This process of getting back ttl=0 repeats for all subsequent re-queries on ttl expiry and Application gets orig ttl only from answer to very first query.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">As can be seen from the attached wireshark, the lowest ttl=5 and my application re-queries every 5 seconds but unbound sends query out only after 6 seconds as can be seen in wireshark.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">Attached unbound.conf.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">Any help will be appreciated.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">Thanks<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US" style="color:black">Sankar Raman<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br><br><p style="font-family: Verdana; font-size:10pt; color:#666666;"><b>Disclaimer</b></p><p style="font-family: Verdana; font-size:8pt; color:#666666;">This e-mail together with any attachments may contain information of Ribbon Communications Inc. and its Affiliates that is confidential and/or proprietary for the sole use of the intended recipient. Any review, disclosure, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please notify the sender immediately and then delete all copies, including any attachments.
</p></body></html>