Forum Discussion
Colin_Walker_12
Feb 16, 2006Historic F5 Account
No problem...
Well, mmoeller is on the right track, if you're looking to do hostname lookups in an iRule. The NAME::lookup command will allow you to do just that.
Something like:
when RULE_INIT {
set ::time [clock clicks -seconds]
}
when HTTP_REQUEST {
if{ [expr {$::time + 30}] <= [clock clicks -seconds] } {
NAME::lookup "hostnametobeused.com"
set ::time [clock clicks -seconds]
} else {
node $::node 80
}
}
when NAME_RESOLVED {
set ::node [NAME::response]
node $::node 80
}
Would probably get you close to where you're trying to go, but I'd be a little concerned about the overhead it would generate, since it would have to process the current time and compare it to the previous one plus the interval (30 in this case). You could possibly set it up so that it only checked every n connections (10, 50, 100, whatever), which might help circumvent this.
Is this the sort of thing you had in mind?
-Colin