I require the ability to create a forwarding server to forward traffic to a hostname rather than an IP address. A third party we are connecting to provides resilience to their systems by a DNS service, allowing them to provide a hostname rather than a string of potential IP addresses and such. Whilst I can add a node to the big-ip by using a hostname, the hostname is resolved to an IP at configuration time. Instead I require a DNS lookup to be performed on a regular basis when the virtual server is in active use. This does not seem possible within the 9.1.1 software, and would appreciate any information to the contrary, or potential workarounds if any are forthcoming.
We here at DevCentral are the folks who work on the API (iControl) and the onboard packet inspector/scripting language (iRules). If you have a question about building iControl apps or writing iRules, this is the place for you.
Unfortunately, this isn’t the place for product technical support. We simply aren’t staffed to handle that side of things. You’ll need to talk to the folks in our product support department for questions like these.
Sorry, i’d already contacted support and they directed me to you in the hope that an irule can help me out… i lazily pasted my support email largely verbatim. sorry if that was confusing, but i was going for an iRule angle here.
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.
Well, assuming that the node in question is not a member of a pool on the BIG-IP, you’d have to log your own stats in the rule.
If the node IS a member of a pool, then you could replace the “node $::node 80” commands with “pool member $::node 80”, and you’d see the stats under the pool in question.
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?
firstly that code doesn’t seem to be intended to fix what i was after. It certainly looks interesting but am not sure that it relates to what i need. I’ve added to the tmm_base (although the tmm_init.tcl customizatin file seems liek a much nicer place to make additions. and then I commented those three lines in named.conf (it was just those 3 right?) and restarted both tmm and named via bigstart… nothing. same blank response.
From my issues, i do appear to be using the (undocumented) NAME::response command wrong, as the example uses [NAME::response address 0] to obtain the actual IP address. but still… no change.
seems i needed to list my forwarding addresses in named.conf and enable recursion there too, and it’s now working, which is great, thanks a lot guys. Should i have to add the forwarders in there though? i’d rather not if i don’t have to, and the above exmaple doesn’t. my name servers are listed in resolv.conf in linux land… can we just refer to them implicitly rather than explicitly listing them?
This raise a question I have in generally… If you guys are saying we need to do x, y or z outside of an irule to achieve this, is this not invalidating my commercial support with F5? Also the fact that I have had intimate changes to bind on each box is pretty invisible to anyone else. If i end up using these changes, i will naturally document them, but when i come to upgrade… all changes will be lost right?
you can make sure the changes survive an upgrade by adding whatever system files you change to the cs.dat file in /usr/libdata/configsync. After you’ve specified the files here (check first to make sure they aren’t already included), they will be backed up when you do a bigpipe config save (and when you do a sync)
Note that there is a problem with adding /etc/syslog-ng/syslog-ng.conf to cs.dat if you are upgrading, search ask.f5.com for the details.