Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Redirect the Nxdomain response

Hi, I've got one iRule to redirect the nxdomain response, but whenever i try it to my lab the rule does not work, please let me know if someone can give any idea on it. I want to redirect it to google.page. using TMOS version 11.6

Thanks....

when DNS_RESPONSE {
 if { [DNS::ptype] == "NXDOMAIN" } {
    DNS::answer insert "[DNS::question name]. 60 [DNS::question class] [DNS::question type] x.x.x.x"
       } 
    }
0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Hi dearsanky,

you have to overwrite the DNS response code "NXDOMAIN" to "NOERROR".

when DNS_RESPONSE {
    if { [DNS::header rcode] eq "NXDOMAIN" } {
        DNS::header rcode NOERROR
        DNS::answer insert "[DNS::question name]. 60 [DNS::question class] [DNS::question type] 1.1.1.1"
    } 
}

Cheers, Kai

0
Comments on this Answer
Comment made 11-Mar-2016 by dearsanky 129
Thanks Kai....its working
0