Forum Discussion
Stanislas_Piro2
Apr 22, 2017Cumulonimbus
Hi 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
}
}