Forum Discussion
Bob_Vance_75936
Jun 14, 2013Altostratus
It'll depend on how you call RESOLV::lookup, but here's an example that's worked for me. Establish global variables and use them to determine when the last lookup was. Takes the current time on the LTM in seconds and checks if the last lookup was done within the last 30 seconds
when RULE_INIT {
set last_dns_request 0
set static::cache_dns 30
if { [clock seconds] - $::last_dns_request > $static::cache_dns } {
set ::last_dns_request [clock seconds]
set ips [RESOLV::lookup @8.8.4.4 www.google.com]
}
}