Forum Discussion
Justin_Poston_4
Nimbostratus
Oct 27, 2006Load balancing clients based on client domain name
I have a need to direct my customers to different web pools based on the domain the client is located on. So far i have only seen one solution that doesn't involve just using ip's and that was to sea...
Deb_Allen_18
Oct 28, 2006Historic F5 Account
You might be able to use [NAME::lookup] against the reverse zone, but keep in mind that not all reverse zones accurately reflect the domain from which the user is connecting. (ISPs frequently retain control over the reverse zones, and refuse to customize, returning always records reflecting some-ISP-specific-infrastructure-based-string+the ISPs own domain name.)
You'd have to have a reliable, low-latency resolver configured on LTM to perform the lookup, and DNS timeouts are relatively long if no response from the authoritative nameserver, so you might have to experiment with VS timeout values to accomodate that possibility.
If those are not insurmountable barriers, something like this might do the trick:
when HTTP_REQUEST {
set PTRname [getfield [IP::client_addr] "." 4].[getfield [IP::client_addr] "." 3].[getfield [IP::client_addr] "." 2].[getfield [IP::client_addr] "." 1].in-addr.arpa.
set clDomain [domain [NAME::lookup $PTRname] 2]
switch $clDomain {
"x.com" { pool x.com }
"y.com" { pool y.com }
"z.com" { pool z.com }
}
}
HTH
/deb
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