Forum Discussion
aalkhuja_160331
Cirrus
Dec 25, 2017iRule to change the DNS response IP inside the header
Hi there,
I want to create an iRule to change the address in the DNS Response header (coming from the DNS) from public IP to private.
Knowing that F5 is not the DNS itself (it is before the DNS)...
stan_piron
Cumulonimbus
Dec 25, 2017you can try something like this:
when DNS_RESPONSE {
set rrs [DNS::answer]
DNS::answer clear
foreach rr $rrs {
if {[lindex $rr 4] equals "4.3.2.1"} {
DNS::answer insert "[lindex $rr 0] [lindex $rr 1] [lindex $rr 2] [lindex $rr 3] 1.2.3.4"
} else {
DNS::answer insert $rr
}
}
}