Forum Discussion
Raj_135327
Nimbostratus
Apr 22, 2017irule to resolve DNS query ( no dns licence on LTM)
I have a VIP to answer dns queries. This VIP forwards all dns queries to 8.8.8.8. Here is the deal i don't want it to forward dns queries say for example: to 8.8.8.8 and want this to be resolved to ...
Stanislas_Piro2
Cumulonimbus
Apr 22, 2017Hi Raj,
I tried oscarnet irule on a VE with only ASM and APM provisioned (Lab license)
it work without GTM provisioned.
Oscarnet's solution seems working except discard action in else statement you must remove.
Here is a solution to support more than 1 record:
when RULE_INIT {
When removing values in array, the array must be unset to clear data.
unset static::DNS_ARRAY
array set static::DNS_ARRAY {
"www.demo.local" "1.1.1.1"
"www2.demo.local" "2.2.2.2"
}
set static::DNS_TTL 600
}
when DNS_REQUEST {
if { [info exists static::DNS_ARRAY([DNS::question name])] } {
DNS::answer insert "[DNS::question name]. $static::DNS_TTL [DNS::question class] [DNS::question type] $static::DNS_ARRAY([DNS::question name])"
DNS::return
}
}
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
