Forum Discussion
rdessert_76127
Nimbostratus
Jul 27, 2012Load balancing to a domain name vs a pool
My organization has a website that has some of its content local and some located at a cloud provider. I have an existing irule which forwards traffic to different pools based upon the URI's. I hav...
Michael_Yates
Nimbostratus
Jul 30, 2012Hi rdessert,
You could use the methods that you outlined to solve your problem.
Performs a DNS query, typically returning the A record for the indicated hostname, or the PTR record for the indicated IP address.
Starting in v10.1, the RESOLV::lookup command has been introduced, which is the inline version of this command.
NAME::lookup
RESOLV::lookup performs a DNS query, returning the A record for the indicated hostname, or the PTR record for the indicated IP address.
RESOLV::lookup
1. Lookup the FQDN of the cloud Provider and save the resolved IP Address to a variable.
2. Use the Node Command to direct the traffic to the IP Address (an example is on the bottom of the RESOLV::lookup Wiki Page).
Select the first returned IP address as the destination IP (inherits the destination port from the client's destination port).
when RULE_INIT {
set static::dns_vs my_dns_vs
}
when CLIENT_ACCEPTED {
Get IP(s) for hostname www.example.com against 4.2.2.1 name server
set ips [RESOLV::lookup @$static::dns_vs -a "www.example.com"]
Log result. If there are multiple IP's it could be a TCL list like {1.1.1.1 2.2.2.2 3.3.3.3}.
log local0. "Looked up www.example.com and found $ips, parsed first element: [lindex $ips 0]"
Check if the first list element was empty
if {$ips eq ""}{
Input wasn't an IP address, take some default action?
} else {
Select the IP
node [lindex $ips 0]
}
}
Hope this helps.
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