Forum Discussion
Brian_69413
Nimbostratus
Jul 09, 2013Pool member selection based on DNS entry
I am looking to use the POOL command in an iRule to select a pool member based on a DNS response from the RESOLV::lookup command. Does the POOL command require that the selected 'member' actually be ...
Brian_69413
Nimbostratus
Jul 09, 2013Awesome, thanks! Let me know if you think I am missing the boat with the below iRULE. It does work and sends traffic to an external site based on DNS response.
when HTTP_REQUEST {
set ips [RESOLV::lookup @1.1.1.1 -a "example.com"]
Check if the first list element was empty
if { $ips eq "" }{
Input wasn't an IP address, using the default pool?
pool default_pool
}
else {
Select the IP
log local0. "IP resolved! - [lindex $ips 0]"
node [lindex $ips 0] 443
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects