Forum Discussion
Mittal_119693
Nimbostratus
Sep 27, 2013DNS::return issue
In DNS_request event, I'm using DNS::return after matching a specific condition but I noticed even after matching specific condition and skipping further TCL processing the irule continues to process...
StephanManthey
Nacreous
Sep 30, 2013Hi 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]"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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