Team, Can anyone help me with an iRule which strips of the domain name and does a DNS query with some other domain name? e.g. The F5 intercepts a request on “xyz.externaldomain.com”. F5 strips of the externaldomain.com and replaces this with “xyz.internaldomain.com” and does a lookup. The IP address returned in the lookup is used for the node in the VIP.
hey Yann…thanks a ton. I think the logic should work. However, we would like to use the new domain to do a lookup and what ever is the IP returned use that IP address in the node to forward the traffic.
Let me work on some extension of iRule with the logic you provided
hey Yann…thanks a ton. I think the logic should work. However, we would like to use the new domain to do a lookup and what ever is the IP returned use that IP address in the node to forward the traffic.
Let me work on some extension of iRule with the logic you provided
please don’t open multiple question for the same topic. It doesn’t make sense if independent people spend their valuable time to answer your redundant questions over and over…
Note: I’ve already told you to add some error handles to your iRule, to become able to indentify where it breaks. In addition to that I’ve linked K12225 [click me] to make sure the DNS on your F5 allows recursive DNS queries. I’ve also speak out the recommendation to setup a DNS Virtual Server to become able to query a pool of redundant DNS servers.
Well, based on your latest requirements (added external / internal DNS domain conversation) the resulting iRule code would look like that…
when HTTP_REQUEST {
if { [HTTP::host] eq "xyz.externaldomain.com" } then {
set ips [lindex [RESOLV::lookup -a "[getfield [HTTP::host] "." 1].internaldomain.com"] 0]
log local0.debug "Debug: Resolved address for \"[getfield [HTTP::host] "." 1].internaldomain.com\" = \"$ips\""
if { $ips ne "" } then {
node $ips [TCP::local_port]
} else {
HTTP::respond 504 content "Bad Request - unknown HOST value"
}
} else {
HTTP::respond 504 content "Bad Request - wrong HOST value"
}
}
yes, it does seem that DNS is messgin up something here. I have commented the same below. Again, I would not know how to set the IP of the node with iRule.
any comments there are well? Sorry for the bugging but trying to get the familiarity.
yes, it does seem that DNS is messgin up something here. I have commented the same below. Again, I would not know how to set the IP of the node with iRule.
any comments there are well? Sorry for the bugging but trying to get the familiarity.
The DNS is just not responding. The queries resolve correctky when I do a lookup from the Linux Kernel and the TMSH. Could there be anything different the iRule needs?
The DNS is just not responding. The queries resolve correctky when I do a lookup from the Linux Kernel and the TMSH. Could there be anything different the iRule needs?