Forum Discussion
Ferzat_263580
Nimbostratus
May 12, 2016Redirect hosts using iRules
Hi all,
How can I achieve the below using iRules.
if clients from [network1, network2...] querying [sub.domain.com] --answer--> 1.2.3.4;
Yann_Desmarest_
Nacreous
May 12, 2016Ok, let's try this one 🙂
when DNS_REQUEST {
set ttl 1800
set A "[DNS::question name]. $ttl [DNS::question class] [DNS::question type]"
if { [string tolower [DNS::question name]] ends_with "sub.domain.com" } {
DNS::answer insert "$A 1.2.3.4"
}
DNS::return
}
Ferzat_263580
Nimbostratus
May 17, 2016Thanks Yann, is the below correct
when DNS_REQUEST {
if { [string tolower [DNS::question name]] ends_with "sub.domain.com" }
{
if { ( [IP::addr [IP::client_addr] equals 10.1.0.0/13] ) or ( [IP::addr [IP::client_addr] equals 10.2.0.0/13] ) }
{
set ttl 10800
set A "[DNS::question name]. $ttl [DNS::question class] [DNS::question type]"
DNS::answer insert "$A 10.10.10.2"
}
}
else {
return
}
DNS::return
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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