Forum Discussion
Forward DNS query to the specific node/pool based on query string - iRule
Hello Everyone,
I have a scenario where the DNS query need to send to the specific node/pool based on a query string.
Example, when user trying to resolve xyz-internal.example.com, the request should be send to the certain node/pool.
Is there any way that, iRule can match the specific string (internal) and based on that forward the request or it can be achieved in any other way?
I have tried on LTM in the LAB but seems like not working.
when DNS_REQUEST {
if {[DNS::question name] matches "internal"} {
node "10.10.10.10"
} else {
node "23.81.50.150"
}
}
- Yoann_Le_Corvi1
Cumulonimbus
Hi,
Try :
when DNS_REQUEST { if {[DNS::question name] matches "internal"} { host "10.10.10.10" } else { host "23.81.50.150" } }
- TechLearner
Nimbostratus
Hi Yoann,
I've tried but the below error occurred.
error: [undefined procedure: host][host "10.10.10.10"]
- Yoann_Le_Corvi1
Cumulonimbus
Hi
Don't you have GTM enabled on the system ? Are you using GTP Irule ?
Yoann
- TechLearner
Nimbostratus
Hi,
No. I'm tried it on LTM.
- TechLearner
Nimbostratus
Is there any way to achieve that goal on LTM?
- Yoann_Le_Corvi1
Cumulonimbus
Hi
Yes, if you have the DNS "Add-On" License, you cas use DNS::answer.
https://clouddocs.f5.com/api/irules/DNS__answer.html
Hope this does the trick for you.
Yoann
- TechLearner
Nimbostratus
Thank you for your suggestion.
Currently I don't have it. Once its arranged, I'll test it.
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