Forum Discussion
mtanfin_90263
Nimbostratus
May 16, 2011DNS_REQUEST
Hi everybody,
I have some trouble with the behavior of the GTM when a DNS_REQUEST occurs.
I would like to manage the request according to the type of the DNS_REQUEST.
I want to get the GTM to process if the type is "A" or "CNAME", forward to a DNS server if "MX", "NS" or "SOA", and reject the request if the type is another one.
Normally, the DNS::rrtype give us the opportunity to manage all the types of DNS but the GTM enters in the irules only if the rrtype is "A". Is it normal?
Here is my irule :
when DNS_REQUEST {
log "RRType : [DNS::rrtype]"
if { ([DNS::rrtype] != "A") or
([DNS::rrtype] == "CNAME")
} {
if { ([DNS::rrtype] == "MX") or
([DNS::rrtype] == "NS") or
([DNS::rrtype] == "SOA")
} {
forward
}
else {
reject
}
}
}
When the DNS_REQUEST is a "A" one, the GTM enters the irule otherwise it doesn't enter the irule.
How can i do to get the GTM have that behavior?
Thanks,
Marylène
6 Replies
- The_Bhattman
Nimbostratus
Hi Marylène,
I have you tried the followingwhen DNS_REQUEST { Log local.0 "RRtype : [DNS::rrtype]" if { !([DNS::rrtype] eq "A") or ([DNS::rrtype] eq "CNAME") } { switch -glob [DNS::rrtype] { "MX" - "NS" - "SOA" { forward } default { reject } } } }
NOTE: This is untested code
I hope this helps
Bhattman - mtanfin_90263
Nimbostratus
Same thing, the irule is not activated when a DNS request occurs.
There is nothing with "RRtype" in the log file.. - The_Bhattman
Nimbostratus
Hi Marylène
So there is the value of [DNS::rrtype] is completely empty in the GTM or LTM log file?
Bhattman - mtanfin_90263
Nimbostratus
When the type of the request is A, I can see the log DNS:RRType in the log.
When the request is another type, i can't see anything with RRType in the log...
I think the irule is not activated in that case.. - mtanfin_90263
Nimbostratus
I found the reason. The TMOS first check the request, and if the rrtype is A,AAAA,A6 or CNAME, it sends the request to the gtm otherwise it forwards the request to the DNS server. So we can just use these rrtype in a GTM irule.
Thanks Bhattman - The_Bhattman
Nimbostratus
You just answered my next response to you. Great job.
Bhattman
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