ltm rule command DNS ptype
iRule(1) BIG-IP TMSH Manual iRule(1)
DNS::ptype
Returns the type of the DNS packet.
SYNOPSIS
DNS::ptype
DESCRIPTION
This iRules command returns the type of the DNS packet.
Note: This command requires the DNS Profile, which is only enabled as
part of GTM or the DNS Services add-on.
Syntax
DNS::ptype
* returns the type of the DNS packet. Return values:
+ QUESTION
+ REFERRAL
+ ANSWER
+ NXDOMAIN
+ NODATA
RETURN VALUE
VALID DURING
DNS_REQUEST, DNS_RESPONSE, GLOBAL_GTM
EXAMPLES
# When a NXDOMAIN response is going to be sent,
# instead attach a record to resolve to.
when DNS_RESPONSE {
if { [DNS::ptype] == "NXDOMAIN" } {
DNS::header rcode NOERROR
DNS::answer insert "[DNS::question name]. 60 [DNS::question class] [DNS::question type] 192.168.1.245"
}
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-11.1.0 --First introduced the command.
BIG-IP 2017-01-31 iRule(1)