DNS::question

Description

This iRules command gets (v11.0+) or sets (v11.1+) the question field value.
Note: This command requires the DNS Profile, which is only enabled as part of GTM or the DNS Services add-on.

Syntax

DNS::question <name|type|class> [value]

DNS::question <name|type|class> [value]

  • gets (v11.0+) or sets (v11.1+) the question field value. Note: A question RR has no rdata and only requests with qdcount == 1 are accepted. The return types for name, type, and class are all strings. Type returns/accepts any of the valid DNS types defined in the RFCs. The class returns/accepts IN, CH, & HS.

Examples

when DNS_REQUEST {
    log local0. "my question name: [DNS::question name]"
}

The follow rule violates the DNS protocol in isolation since a client won’t understand the response (i.e., we changed the question name) but let’s assume there’s intercept code in DNS_RESPONSE to handle it and restore it to the original question name
when DNS_REQUEST {
        set my_rr [DNS::rr "example.net A IN 10 1.2.3.4"]
        DNS::question name $my_rr
}