Forum Discussion
mtanfin_90263
May 16, 2011Nimbostratus
DNS_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
- The_BhattmanNimbostratusHi Marylène,
when 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 } } } }
- mtanfin_90263NimbostratusSame thing, the irule is not activated when a DNS request occurs.
- The_BhattmanNimbostratusHi Marylène
- mtanfin_90263NimbostratusWhen the type of the request is A, I can see the log DNS:RRType in the log.
- mtanfin_90263NimbostratusI 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.
- The_BhattmanNimbostratusYou just answered my next response to you. Great job.
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