DNS::query

Description

This iRules command returns or constructs and sends a query to the DNS-Express database for a name and type (IN class only).
Note: This command requires the DNS Profile, which is only enabled as part of GTM or the DNS Services add-on.

Syntax

DNS::query <target> <name> <type> [dnssec]

DNS::query [dnssec]

  • Returns a tcl list of RR tcl objects lists, one for each section: Answer, Authority, & Additional.
  • Constructs and sends a query to the DNS-Express database for a name and type (IN class only. dnnsec is an option to get DNSSEC data.)
    • target - dnsx only
    • name (FQDN, e.g. devcentral.f5.com)
    • type (e.g. A, AAAA, MX, NS, PTR, etc.)
    • dnssec (boolean)

Examples

Insert DNS Express response
when DNS_RESPONSE {
    set rrsl [DNS::query dnsx nameserver.org SOA]
    foreach rrs $rrsl {
        foreach rr $rrs {
            if { [DNS::type $rr] == "SOA" } {
                DNS::additional insert $rr
            }
        }
    }
}