Forum Discussion

dyonadi_313056's avatar
dyonadi_313056
Icon for Nimbostratus rankNimbostratus
Feb 25, 2019

DNS answer based on specifiv domain

Hi! I have a VS and its pool's member is a cache DNS farm. I need to get an iRule that answers a "custom" IP for a specific DNS query based on the domain name and let non matching queries pass through the actual pool. I started like this:

 

when DNS_REQUEST { if { [DNS::question name] ends_with "example.com.ar" }

 

But don't know if I gotta follow with DNS::answer and how exactly use the insert values. I can really use some help here so, thanks in advance!

 

1 Reply

  • You are very much along the right lines there. Have a go with this and see how you get on:

    when DNS_REQUEST { 
        if { [DNS::question name] ends_with "example.com.ar" } {
            DNS::answer clear
            DNS::answer insert [DNS::rr "host.domain.com" A IN 50 "1.2.3.4"]
            DNS::header aa 1   
            DNS::return
        }
    }