Forum Discussion
Ian_Lohning_383
Nimbostratus
Mar 19, 2014Is it possible to use iRules to replicate a very basic DNS
Guys,
I have a need to write up an irule that will be able to receive any DNS requests and always respond with the same IP address. ( The function is designed to work with a HTTP redirect func...
John_Alam_45640
Mar 20, 2014Historic F5 Account
I did address the question before I provided alternatives. 🙂
You missed this line:
Check out this page, it has examples: https://devcentral.f5.com/wiki/iRules.DNS__answer.ashx
Check out the link, there are examples. On an LTM you will need a DNS services license. On a GTM you are good to go.
Here is one of the examples:
Send one or more IP addresses for a response to an A query
Use on an LTM virtual server with a DNS profile enabled
when DNS_REQUEST {
Log query details
log local0. "\[DNS::question name\]: [DNS::question name],\
\[DNS::question class\]: [DNS::question class],
\[DNS::question type\]: [DNS::question type]"
Generate an answer with two A records
DNS::answer insert "[DNS::question name]. 111 [DNS::question class] [DNS::question type] 1.1.1.1"
DNS::answer insert "[DNS::question name]. 111 [DNS::question class] [DNS::question type] 1.1.1.2"
Stop further processing of the query after this iRule and send the answer to the client
DNS::return
}
HTH
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