<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>On Tue, Feb 14, 2023, at 04:04, Aditya Sharma wrote:<br></div><blockquote type="cite" id="qt" style=""><div dir="ltr"><div>Hi Kevin,<br></div><div><br></div><div><i>If what you mean is that you want to serve 'stale' records from a cache when their TTLs have expired and the authoritative servers which provided them are not reachable, that's something that a number of existing recursive resolvers are able to do and it could be logical for systemd-resolved to offer it too.<br></i></div><div>We are looking to prepare a solution similar to this, to serve back records for <b>FQDN</b>s in case of <b>timeout </b>from the DNS server.<br></div><div>We want to understand how we can extend systemd-resolved to override response from DNS server in case of timeouts/failures.<br></div></div></blockquote><div><br></div><div>Again, you need to be very specific in your request.<br></div><div><br></div><div>systemd-resolved communicates with one or more recursive resolvers (what you are calling "DNS server", but that term is ambiguous). If those resolvers are not operational, systemd-resolved will continue serving records from its cache (if the cache is enabled), until their TTLs expire.<br></div><div><br></div><div>When the TTLs expire, those records in the cache become 'stale', and are normally purged. Your request is to have an option in systemd-resolved to *not* purge those records, but to continue serving them in case it is unable to communicate with the configured recursive resolver(s).<br></div><div><br></div><div>In your original message you referred to a 'negative response' from the "DNS server", but that's a completely different situation.<br></div><div><br></div></body></html>