title: DNS failover cache in-case DNS lookup fails - AWS ELB
body: <p>I have a system where all incoming requests are routed to an AWS elastic load balancer (ELB). This requires a a DNS name lookup on the ELB URL for every request. We know that the ELB returns a different IP every time (round robins a couple of IP addresses) so I can't really cache the IP address and the use it till TTL. </p>
  
  <p>However, sometimes these DNS lookups would fail and we want to use the cache only when that happens. Please note that the cache needs to be updated always so when we do fall back to the cache, it's not an old cached entry. </p>
  
  <p>What's the best way to do this? Can we use dnsmasq somehow?</p>