<html><head></head><body><div style="color:black;font-size:14px">Hello.<br></div><div style="color: black;font-size: 14px;">I will have a look at LUA records.<br></div><div style="color: black;font-size: 14px;"><div style="color: black;font-size: 14px;">Thank you all for your help.<br></div><div style="color: black;font-size: 14px;">Riccardo</div></div><div><br></div><div>26/09/2023, 19:51 Victor Hugo dos Santos  ha scritto:<br></div><blockquote style="border-left: 2px solid #a8a8a8;margin-left: 0px;padding-left: 10px;margin-top: 0.5rem;"><div>BTW,<br></div><div> <br></div><div> The lua configuration will only deliver the list of the servers<br></div><div> available for the new queries. For example, let imagine you have the 3<br></div><div> registers www and a TTL of 1 hour:<br></div><div> <br></div><div> - One client makes a query for the www register and will store it<br></div><div> locally for 1 hour<br></div><div> - 5 minutes later, one of your servers goes down.<br></div><div> - the PDNS will now only respond to the www queries with the 2<br></div><div> available servers/IPs.<br></div><div> - but the first client, will maintain the 3 IPs/servers on it cache<br></div><div> - the client browser will then try to connect to one of your servers,<br></div><div> but if it is unavailable, it will try the next one<br></div><div> - after 55 minutes more, the first client will ask again for the www<br></div><div> register and then will get only the 2 available servers/IPs.<br></div><div> <br></div><div> So, you can reduce the TTL of the www register from 1 hour to 60 or 30<br></div><div> seconds and try to reduce/eliminate this "dead connection" on the<br></div><div> client side, "but" with these change you will increase the queries<br></div><div> that the clients are doing to the DNS servers. ;-/<br></div><div> <br></div><div> you need to pick one !! :-D<br></div><div> <br></div><div> Salu2<br></div><div> <br></div><div> On Tue, 26 Sept 2023 at 19:37, Victor Hugo dos Santos<br></div><div> <<a href="mailto:listas.vhs@gmail.com">listas.vhs@gmail.com</a>> wrote:<br></div><div> ><br></div><div> > Hello there,<br></div><div> ><br></div><div> > you mean, something like this:<br></div><div> > <a href="https://doc.powerdns.com/authoritative/lua-records/index.html">https://doc.powerdns.com/authoritative/lua-records/index.html</a><br></div><div> ><br></div><div> > Anyway, you don't need it for http protocol, because it is included by<br></div><div> > default in almost all the browsers (rfc8305 if I remember well), so,<br></div><div> > you only need to create the registers:<br></div><div> ><br></div><div> > www IN A 1.1.1.1.1<br></div><div> > www IN A 2.2.2.2.2<br></div><div> > www IN A 3.3.3.3.3<br></div><div> ><br></div><div> > and it will create a round robin for you on the DNS server and if the<br></div><div> > web server on 1.1.1.1 is down, the client will automatically use the<br></div><div> > others servers.<br></div><div> ><br></div><div> > Note: There is a small performance, because the browser will need to<br></div><div> > contact the next server if the first is down.<br></div><div> ><br></div><div> > Salu2<br></div><div> ><br></div><div> > On Tue, 26 Sept 2023 at 18:43, Riccardo Brunetti via Pdns-users<br></div><div> > <<a href="mailto:pdns-users@mailman.powerdns.com">pdns-users@mailman.powerdns.com</a>> wrote:<br></div><div> > ><br></div><div> > > Hello everybody.<br></div><div> > > I'm trying to figure out if it is possible to make pdns (or dnsdist) to return a different answer according to the availability of a service.<br></div><div> > > Suppose we have:<br></div><div> > ><br></div><div> > > - server A with IP: <a href="http://XXX.XXX.XXX.XXX">XXX.XXX.XXX.XXX</a><br></div><div> > > - server B with IP: YYY.YYY.YYY.YYY<br></div><div> > ><br></div><div> > > Server A and B are two web servers which are configured to answer to a given http GET like <a href="http://myservice.net">http://myservice.net</a>.<br></div><div> > > They are both configured in the same way and are independent.<br></div><div> > ><br></div><div> > > I would like the DNS query to return <a href="http://XXX.XXX.XXX.XXX">XXX.XXX.XXX.XXX</a> as long as the server A is working (returns 200 to the GET) or return YYY.YYY.YYY.YYY when server A is not working.<br></div><div> > > In other words, I would like to have two records A for <a href="http://myservice.net">myservice.net</a> with a somehow "intelligent" behavior and not a simple round-robin.<br></div><div> > ><br></div><div> > > Can you suggest me how to achieve this, if it's possible?<br></div><div> > ><br></div><div> > > Thanks a lot<br></div><div> > > Riccardo<br></div><div> > ><br></div><div> > ><br></div><div> > > _______________________________________________<br></div><div> > > Pdns-users mailing list<br></div><div> > > <a href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a><br></div><div> > > <a href="https://mailman.powerdns.com/mailman/listinfo/pdns-users">https://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br></div><div> ><br></div><div> ><br></div><div> ><br></div><div> > --<br></div><div> > --<br></div><div> > Victor Hugo dos Santos<br></div><div> > <a href="http://www.vhsantos.net">http://www.vhsantos.net</a><br></div><div> > Linux Counter #224399<br></div><div> <br></div><div> <br></div><div> <br></div><div> -- <br></div><div> --<br></div><div> Victor Hugo dos Santos<br></div><div> <a href="http://www.vhsantos.net">http://www.vhsantos.net</a><br></div><div> Linux Counter #224399<br></div></blockquote><div style="color: black;font-size: 14px;"><br></div></body></html>