ltm rule command DATAGRAM dns
iRule(1) BIG-IP TMSH Manual iRule(1)
DATAGRAM::dns
Returns DNS header information.
SYNOPSIS
DATAGRAM::dns (id | qr | opcode | qdcount | ancount | nscount |
arcount)
DESCRIPTION
This iRules command returns DNS header information.
Note: L4 protocol of the packet must be either TCP or UDP for this
command
to work. Also, the L4 port must be equal to the dns port
(typically port 53).
DATAGRAM::dns id
* Returns DNS header 16-bit aXXidentificationaXX field as an integer value.
DATAGRAM::dns qr
* Returns DNS header aXXquery/responseaXX as a boolean value.
0 indicates a aXXqueryaXX and 1 indicates a aXXresponseaXX.
DATAGRAM::dns opcode
* Returns DNS header aXXopcodeaXX as a string.
Values include aXXQueryaXX, aXXIQueryaXX, aXXStatusaXX, aXXNotifyaXX, aXXUpdateaXX and aXXUnassignedaXX.
DATAGRAM::dns qdcount
* Returns DNS header field aXXquestion countaXX as an integer value.
DATAGRAM::dns ancount
* Returns DNS header field aXXanswer countaXX as an integer value.
DATAGRAM::dns nscount
* Returns DNS header field aXXauthority record countaXX as an integer value.
DATAGRAM::dns qdcount
* Returns DNS header field aXXadditional record countaXX as an integer value.
RETURN VALUE
VALID DURING
FLOW_INIT, CLIENT_DATA
EXAMPLES
when FLOW_INIT {
if { [IP::protocol] == 6 } {
log local0. "TCP Payload Length = [DATAGRAM::tcp payload_length] Payload: [DATAGRAM::tcp payload 100]"
log local0. "DNS Header fields ID: [DATAGRAM::dns id] QR: [DATAGRAM::dns qr] OPCODE: [DATAGRAM::dns opcode] QDCOUNT: [DATAGRAM::dns qdcount]"
}
if { [IP::protocol] == 17 } {
log local0. "UDP Payload Length = [DATAGRAM::udp payload_length] Payload: [DATAGRAM::udp payload 100]"
log local0. "DNS Header fields ID: [DATAGRAM::dns id] QR: [DATAGRAM::dns qr] OPCODE: [DATAGRAM::dns opcode] QDCOUNT: [DATAGRAM::dns qdcount]"
}
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-12.0.0 --First introduced the command.
BIG-IP 2017-01-31 iRule(1)