RESOLV::lookup questions

Hi everyone,

I’m using an irule where I use RESOLV::lookup to determine the destination for ongoing connections. I have some concerns about a failure scenario where the FQDN could not be resolved :

  • What will happen if we will get a NXDOIMAIN response ?
  • In case the DNS server returns multiple A queries, will they all be stored in the cache?
  • Is there iRule command that can be used to loop through the returned A queries?
  • Will DNS cache TTL over rule the TTL in the response?

Thanks in advance for your answers! Liviu

Put lookup result in a list:

set addr_list [RESOLV::lookup @8.8.8.8 -a example.com"

 Check if there is any entry found:

if { [llength $addr_list] > 0 } {
    foreach addr_found $addr_list {
         Do something.
    }
} else {
     No entry found.
}

See https://devcentral.f5.com/wiki/irules.resolv__lookup.ashx, which also answers your questions about result caching.

I wrote the following code share that may be useful as it includes a caching feature using subtables.