Forum Discussion

walou12_113339's avatar
walou12_113339
Icon for Nimbostratus rankNimbostratus
Jun 25, 2014

help with a DNS response irule

HI, I'm looking for help with an irule that will be attached to a DNS VIP on a LTM v11.x. Its purpose is to supply a fixed response to a particular client querie, all other queries go to the DNS pool.

 

so far i have

 

when DNS_REQUEST {

 

if

 

{ [DNS::question name] ends_with "msftncsi.com" }

 

{ DNS::answer insert "$fqdn. 125.56.204.104"}

 

else { pool internal-dns }

 

}

 

can anyone help build a proper DNS::answer command line ? appreciate your time, cheers

 

2 Replies

  • kunjan's avatar
    kunjan
    Icon for Nimbostratus rankNimbostratus

    Try this:

    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 "msftncsi.com" } { 
         DNS::answer insert  "$A 125.56.204.104"
      }
      else {
         pool internal-dns
       }
      DNS::return
    }
    
  • thanks kunjan,

     

    i get this error

     

    [ltm_rule_dns_write feature not licensed] [DNS::answer insert "$A 125.56.204.104"]

     

    do you know if there is any way to achieve a similar outcome, without this additional licence ?