Forum Discussion
DNS redirect
Guys,
I need to redirect a DNS traffic to a specific node, example:
If name is alpha.com redirect to node 192.168.1.1 else redirect to node 8.8.8.8 (google DNS)
It´s like host file does but i cannot change this because are mobile devices, mac books and more.
Thank´s a lot.
5 Replies
- Cory_50405
Noctilucent
Try attaching this iRule to your listener:
when DNS_REQUEST { if { [DNS::question name] equals "alpha.com" } { host 192.168.1.1 } else { host 8.8.8.8 } } - Mauro_Patriota_
Nimbostratus
Hi Cory,
Thank´s for the feedback, i put this code but i got the error:
01070151:3: Rule [/Common/DNS_REDIRECT] error: line 3: [undefined procedure: host] [host 192.168.1.1]
Can u help me?
- Cory_50405
Noctilucent
Apologies, 'host' should be 'node':
when DNS_REQUEST { if { [DNS::question name] equals "alpha.com" } { node 192.168.1.1 } else { node 8.8.8.8 } } - Mauro_Patriota_
Nimbostratus
Now it´s accepted. Thank´s
I need to change anything on DNS profile?
- Cory_50405
Noctilucent
No DNS profiles changes should be necessary in order to do this.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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