Forum Discussion
GTM DNS REQUEST
Hi All, I need an IRule for GTM so when I receive a DNS Request if it is looking for; .gcsx.gov.uk or gsi.gov.uk (and there are a few more domains) then forward it to Pool 1 or if it is looking for nhs.uk forward it to Pool 2 or if it is looking for any think else forward it to its default Pool. Is this possible (I hope it is !!!) ?
7 Replies
- Cory_50405
Noctilucent
This iRule uses data groups and should allow you some more flexibility going forward, if you wish to add more domains. This will require you to create two data groups (string type is fine) in order for this to work:
dotuk_group (include gcsx.gov.uk and gsi.gov.uk domains)
nhs_group (include nhs.uk domain)
This iRule should work for you:
when DNS_REQUEST { DNS::question name [string tolower [DNS::question name]] if { [class match [DNS::question name] eq dotuk_group] } { DNS::disable all pool pool1 } elseif { [class match [DNS::question name] eq nhs_group] } { DNS::disable all pool pool2 } else { DNS::disable all pool default_pool } } - paul_dcc
Nimbostratus
Thanks for the IRule, just one question what does DNS::disable all do ?
- paul_dcc
Nimbostratus
Hi Cosby,
I can't get the wildcard to match, I'm running Ver 11.5 and the only way I can get any match within the Data Group is to have the exact same thing; mail.gcsx.gov.uk (have that in the Data Group would get a match) but having *.gcsx.gov.uk would not match mail.gcsx.gov.uk ??? I can't see what I'm doing wrong.
Hope you can help.................
- Cory_50405
Noctilucent
DNS::disable all just prevents any further processing of DNS (GTM, ZoneRunner), since you're forwarding the query somewhere else for resolution.
Instead of an exact match, the iRule can be modified to match for "ends with". Like this:
when DNS_REQUEST { DNS::question name [string tolower [DNS::question name]] if { [class match [DNS::question name] ends_with dotuk_group] } { DNS::disable all pool pool1 } elseif { [class match [DNS::question name] ends_with nhs_group] } { DNS::disable all pool pool2 } else { DNS::disable all pool default_pool } }So there's no need for you to put the wildcard FQDN in your dotuk_group. Just put it in as gcsx.gov.uk and the ends_with will match anything of that domain or any sub domains.
- Robert_47833
Altostratus
it seems dns::disable all doesn't disable dns cache
- paul_dcc
Nimbostratus
Cheers Cory it work's great now,
Many Thanks
- Cory_50405
Noctilucent
Glad to hear it's working for you.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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