Forum Discussion
Chris_Phillips
Mar 09, 2006Nimbostratus
Hi,
Thanks for the advice so far, but something is not working right. My iRule as it stands reads like this:
when RULE_INIT {
set ::hostname "example.com"
set ::max 10
set ::count 0
set ::server_ip "192.168.0.1"
}
when CLIENT_ACCEPTED {
node $::server_ip 80
incr ::count
if { $::count == $::max } {
set ::count 0
NAME::lookup $::hostname
}
}
when NAME_RESOLVED {
log local0. "NAME_RESOLVED: [NAME::response]"
set ::server_ip [NAME::response]
}
It works fine to start with, and after the max limit is reached the lookup fires off. I then get the NAME_RESOLVED event, yet NAME::response returns nothing, and the whole thing chokes. i can dig the destination hostname on the box no problem, so would assume that there is no inherent problem on the box in terms of dns resources. Additionally i would assume that that event would only be triggered on a valid resolution, not every single return value. Any clues guys?
Thanks
Chris