Hi Mit,
thanks for the update from your side. In my answer I also mentioned the 'event' command. Perhaps you want to skip the processing in context of DNS_RESPONSE or you have a second iRule with a lower priority attached to your virtual server. The 'event disable' will prevent the triggering of lower prioritized events of same types while the 'event disable all' will also avoid the processing in context of i.e. DNS_RESPONSE.
Some sample code for testing and verification attached.
Make sure to use the udp_gtm_dns profile (w/ datagram load balancing).
Thanks, Stephan
when DNS_REQUEST {
log local0. "request for [DNS::question name] [DNS::question class] [DNS::question type]"
switch [DNS::question type] {
A {
DNS::answer insert "[DNS::question name]. 30 [DNS::question class] [DNS::question type] 10.245.245.101"
DNS::return
event disable all
return
}
AAAA {
DNS::answer insert "[DNS::question name]. 30 [DNS::question class] [DNS::question type] 2001:0:0:f5::101"
DNS::return
event disable all
return
}
CNAME {
DNS::answer insert "[DNS::question name]. 30 [DNS::question class] [DNS::question type] alias.lb-net.bit"
DNS::return
event disable all
return
}
default {
pool pool_dns
}
}
}
when LB_SELECTED {
log local0. "[LB::server] selected"
}
when DNS_RESPONSE {
foreach item [DNS::answer] {
log local0. "[DNS::rdata $item] [DNS::type $item]"
}
}