---
title: "Configuring dnstap"
canonical: "https://docs.infoblox.com/space/nios85/35752233/Configuring%20dnstap"
format: markdown
---
<span style="color: #000000">You can use the dnstap log format to log DNS queries and responses at high rates to well-known destinations. NIOS logs all valid DNS queries and responses that are not dropped by Advanced DNS Protection. For information about dnstap, see</span> [*<span style="color: #0000ff">https://dnstap.info/</span>*](https://dnstap.info/)<span style="color: #000000">.</span>

<span style="color: #000000">For information about capturing DNS queries and responses without using dnstap, see</span> [*<span style="color: #0000ff">Capturing DNS Queries and Responses</span>*](https://infoblox-docs.atlassian.net/wiki/spaces/nios85/pages/35816694)<span style="color: #000000">.</span>

> ⚠️ **Note**
> ⚠️ 
> ⚠️ <span style="color: #000000">dnstap for high-performance query logging is supported on Infoblox appliances with Advanced DNS Protection or DNS Cache Acceleration running on them.</span>

# <span style="color: #000000">About dnstap Implementation</span>

<span style="color: #000000">dnstap is implemented using the Google protocol buffer (protobuf) for packaging logged data, and Frame Streams as a lightweight streaming protocol to transmit the data to a receiver.</span>

<span style="color: #000000">A bi-directional communication starts with a 3-way handshake sequence of Frame Streams control packets over a TCP (or other reliable byte-streaming). The following figure illustrates the connection between the transmitter and receiver pair.</span>

*<span style="color: #000000">Packet Flow for Frame Streams 3-way handshake initialization and data frames over a TCP connection</span>*

![image](media://3952f949-8ad2-4f64-9518-8523d5e4b420)

<span style="color: #000000">The transmitter initiates the communications to the receiver by first sending a READY control frame carrying the </span>`protobuf:dnstap.Dnstap`<span style="color: #000000"> string. The receiver responds with an ACCEPT control frame carrying the same </span>`protobuf:dnstap.Dnstap`<span style="color: #000000"> string. The handshake is completed when the transmitter sends a START control frame carrying the same </span>`protobuf:dnstap.Dnstap`<span style="color: #000000"> string.</span>

*<span style="color: #000000">Frame Streams Control Frame Format</span>*

![image](media://406ad52f-ed25-47d5-8af8-78db98d29898)

<span style="color: #000000">Data packets are carried over the connection with only a 4-byte framing overhead as illustrated in the following figure.</span>

*<span style="color: #000000">Frame Streams Data Frame Format</span>*

![image](media://00df81bb-89c6-4bd3-822f-dc56db3f49a4)

<span style="color: #000000">To end the bi-directional communication that is shown in the following figure, the sequence starts with a STOP control frame from one of the communicating pairs, followed by a FINISH acknowledgment control frame from the other half of the pair.</span>

*<span style="color: #000000">Packet flow for Frame Streams termination over a TCP connection</span>*

![image](media://88998dd8-b749-4b93-badd-57fdd1e7793e)

# <span style="color: #000000">Protobuf Template for Infoblox dnstap</span>

<span style="color: #000000">The following is a sample template that you can create for flexible and efficient use of your logged data. You can specify the way in which information must be logged by defining protobuf message types. </span>

`// dnstap: flexible, structured event replication format for DNS software,`  
`// This file contains the protobuf schemas for the "dnstap" structured event `  
`// replication format for DNS software.`  
`// Written in 2013-2014 by Farsight Security, Inc.`  
`// Updated in 2019-2020 by Infoblox, Inc.`  
`// To the extent possible under law, the author(s) have dedicated all copyright `  
`// and related and neighboring rights ``to this file to the public domain worldwide. `  
`// This file is distributed without any warranty.`  
`// You should have received a copy of the CC0 Public Domain Dedication along with this file.`  
`// If not, see:`  
`// <`[<span style="color: #0000ff">http://creativecommons.org/publicdomain/zero/1.0/</span>](http://creativecommons.org/publicdomain/zero/1.0/)`>. ``package dnstap;`  
`// "Dnstap": this is the top-level dnstap type, which is a "union" type that`  
`// contains other kinds of dnstap payloads, although currently only one type`  
`// of dnstap payload is defined.`  
`// See: `[<span style="color: #0000ff">https://developers.google.com/protocol-buffers/docs/techniques#union</span>](https://developers.google.com/protocol-buffers/docs/techniques#union)  
`message Dnstap {`  
`// DNS server identity.`  
`optional bytes identity = 1;`  
`// DNS server version.`  
`optional bytes version = 2;`  
`// Extra data for this payload.`  
`optional bytes extra = 3;`  
`// Identifies which field below is filled in.`  
`enum Type {`  
`MESSAGE = 1;`  
`}`  
`required Type type = 15;`  
`// One of the following will be filled in.`  
`optional Message message = 14;`  
`}`  
`// SocketFamily: the network protocol family of a socket. This specifies how`  
`// to interpret "network address" fields.`  
`enum SocketFamily {`  
`INET = 1; // IPv4 (RFC 791)`  
`INET6 = 2; // IPv6 (RFC 2460)`  
`}`  
`// SocketProtocol: the transport protocol of a socket. This specifies how to`  
`// interpret "transport port" fields.`  
`enum SocketProtocol {`  
`UDP = 1; // User Datagram Protocol (RFC 768)`  
`TCP = 2; // Transmission Control Protocol (RFC 793)`  
`}`  
`// Message: a wire-format (RFC 1035 section 4) DNS message and associated`  
`// metadata. Applications generating "Message" payloads should follow`  
`// certain requirements based on the MessageType, see below.`  
`message Message {`  
`// We are supporting the following types of messages`  
`// CQ: CLIENT_QUERY`  
`// CR: CLIENT_RESPONSE`  
`enum Type {`  
`// CLIENT_QUERY is a DNS query message sent from a client to a DNS`  
`// server which is expected to perform further recursion, from the`  
`// perspective of the DNS server. The client may be a stub resolver or`  
`// forwarder or some other type of software which typically sets the RD`  
`// (recursion desired) bit when querying the DNS server. The DNS server`  
`// may be a simple forwarding proxy or it may be a full recursive`  
`// resolver.`  
`CLIENT_QUERY = 5;`  
`// CLIENT_RESPONSE is a DNS response message sent from a DNS server to`  
`// a client, from the perspective of the DNS server. The DNS server`  
`// typically sets the RA (recursion available) bit when responding.`  
`CLIENT_RESPONSE = 6;`  
`}`  
`// One of the Type values described above.`  
`required Type type = 1;`  
`// One of the SocketFamily values described above.`  
`optional SocketFamily socket_family = 2;`  
`// One of the SocketProtocol values described above.`  
`optional SocketProtocol socket_protocol = 3;`  
`// The network address of the message initiator.`  
`// For SocketFamily INET, this field is 4 octets (IPv4 address).`  
`// For SocketFamily INET6, this field is 16 octets (IPv6 address).`  
`optional bytes query_address = 4;`  
`// The network address of the message responder.`  
`// For SocketFamily INET, this field is 4 octets (IPv4 address).`  
`// For SocketFamily INET6, this field is 16 octets (IPv6 address).`  
`optional bytes response_address = 5;`  
`// The transport port of the message initiator.`  
`// This is a 16-bit UDP or TCP port number, depending on SocketProtocol.`  
`optional uint32 query_port = 6;`  
`// The transport port of the message responder.`  
`// This is a 16-bit UDP or TCP port number, depending on SocketProtocol.`  
`optional uint32 response_port = 7;`  
`// The time at which the DNS query message was sent or received, depending`  
`// on whether this is an AUTH_QUERY, RESOLVER_QUERY, or CLIENT_QUERY.`  
`// This is the number of seconds since the UNIX epoch.`  
`optional uint64 query_time_sec = 8;`  
`// The time at which the DNS query message was sent or received.`  
`// This is the seconds fraction, expressed as a count of nanoseconds.`  
`optional fixed32 query_time_nsec = 9;`  
`// The initiator's original wire-format DNS query message, verbatim.`  
`optional bytes query_message = 10;`  
`// This is a wire-format DNS domain name.`  
`// Currently, we are not supporting this.`  
`optional bytes query_zone = 11;`  
`// The time at which the DNS response message was sent or received,`  
`// depending on whether this is an CLIENT_RESPONSE.`  
`// This is the number of seconds since the UNIX epoch.`  
`optional uint64 response_time_sec = 12;`  
`// The time at which the DNS response message was sent or received.`  
`// This is the seconds fraction, expressed as a count of nanoseconds.`  
`optional fixed32 response_time_nsec = 13;`  
`// The responder's original wire-format DNS response message, verbatim.`  
`optional bytes response_message = 14;`  
`// Start of Infoblox specific log messages`  
`optional bytes subscriber_id = 15; // 32 bytes`  
`optional uint64 local_id = 16; // 8 bytes`  
`optional bytes pcp_ssp = 17; // 16 bytes`  
`optional bytes proxy_all = 18; // Proxy all`  
`optional bytes fqdn = 19; // MAX 255 bytes`  
`required uint32 txid = 20; //16-bit transaction id`  
`}`  
`// All fields except for 'type' in the Message schema are optional.`  
`// It is recommended that at least the following fields be filled in for`  
`// particular types of Messages.`  
`// CLIENT_QUERY:`  
`// socket_family, socket_protocol`  
`// query_message`  
`// query_time_sec, query_time_nsec`  
`// CLIENT_RESPONSE:`  
`// socket_family, socket_protocol`  
`// query_time_sec, query_time_nsec`  
`// response_message`  
`// response_time_sec, response_time_nsec`

# <span style="color: #000000">Configuring dnstap to Log DNS Queries and Responses</span>

<span style="color: #000000">You can use the dnstap log format to log DNS queries and responses at high rates to well-known destinations and achieve high performance query  and response logging. NIOS logs a</span><span style="color: #000000">ll valid DNS queries and responses that are not dropped by Advanced DNS Protection. For information about dnstap, see </span>[<span style="color: #0000ff">*https://dnstap.info/*</span>](https://dnstap.info/)*<span style="color: #000000">.</span>*

<span style="color: #000000">To use the dnstap log format, you need to enable dnstap by running the </span>[*<span style="color: #0000ff">set enable_dnstap</span>*](https://infoblox-docs.atlassian.net/wiki/spaces/nios85/pages/35446376)<span style="color: #000000"> </span><span style="color: #000000">command</span><span style="color: #000000">. </span><span style="color: #000000">To view whether the dnstap log format is enabled or disabled, run the </span>[*<span style="color: #000000">show dnstap-status</span>*](https://infoblox-docs.atlassian.net/wiki/spaces/nios85/pages/35749892)<span style="color: #000000"> </span><span style="color: #000000">command. To view the number of queries and responses sent to the destination when the dnstap log format is enabled for high-performance logging of queries and responses, run the </span>[*<span style="color: #0000ff">show dnstap-stats</span>*](https://infoblox-docs.atlassian.net/wiki/spaces/nios85/pages/35383154)<span style="color: #000000"> </span><span style="color: #000000">command.</span>

<span style="color: #172b4d">If you choose to enable the dnstap log format, you will not be able to capture queries and responses using the </span><span style="color: #333333">**Data connector for all DNS Queries/Responses to a Domain**</span><span style="color: #333333"> </span><span style="color: #172b4d">fields. And if you use the </span><span style="color: #333333">**Data connector for all DNS Queries/Responses to a Domain**</span><span style="color: #333333"> </span><span style="color: #172b4d">fields for query capture, the </span>**<span style="color: #000000">DNSTAP settings for DNS Queries/Responses</span>**<span style="color: #172b4d"> fields are disabled.</span>

> ⚠️ **Note**
> ⚠️ 
> ⚠️ <span style="color: #000000">For Advanced DNS Protection software with acceleration, you must download the latest ruleset before enabling dnstap.</span>

## <span style="color: #000000">Limitations of Using dnstap to Log Queries and Responses</span>

<span style="color: #000000">Ensure that you understand the following limitations before you use dnstap to log queries and responses:</span>

- <span style="color: #000000">dnstap supports UDP, TCP, and EDNS protocols that require additional processing thus leading to a decrease in performance.</span>
- <span style="color: #000000">NIOS does not support BIND9 dnstap.</span>
- <span style="color: #000000">If the remote logging server is not accessible, then the logs are dropped and not buffered.</span>
- <span style="color: #000000">The dnstap server cannot truncate </span><span style="color: #1d1c1d">EDNS0</span><span style="color: #000000"> queries.</span>
- <span style="color: #000000">If you run a query that contains +edns=1, a dnstap server that uses the Golang DNS library to process the captured data displays it as a bad signature (TSIG signature failure).</span>
- <span style="color: #000000">Capturing the queries and responses also depends on other factors such as the size of the flavor deployed and features enabled over it.</span>
- <span style="color: #000000">dnstap does not support query and response logging on the MGMT interface.</span>
- <span style="color: #000000">For long-running queries, using dnstap may cause some </span><span style="color: #000000">response</span><span style="color: #000000"> packets to be dropped.</span>

## <span style="color: #000000">Configuring dnstap to Log DNS Queries and Response Captures</span>

<span style="color: #000000">To configure dnstap to log DNS queries and to capture responses, complete the following:</span>

1. **<span style="color: #000000">Grid</span>**<span style="color: #000000">: From the </span>**<span style="color: #000000">Data</span>**<span style="color: #000000"> </span>**<span style="color: #000000">Management</span>**<span style="color: #000000"> tab, select the </span>**<span style="color: #000000">DNS</span>**<span style="color: #000000"> tab, expand the </span>**<span style="color: #000000">Toolbar,</span>**<span style="color: #000000"> and then click </span>**<span style="color: #000000">Grid</span>**<span style="color: #000000"> </span>**<span style="color: #000000">DNS</span>**<span style="color: #000000"> </span>**<span style="color: #000000">Properties</span>**<span style="color: #000000">.</span>  
**<span style="color: #000000">Member</span>**<span style="color: #000000">: From the </span>**<span style="color: #000000">Data</span>**<span style="color: #000000"> </span>**<span style="color: #000000">Management</span>**<span style="color: #000000"> tab, select the </span>**<span style="color: #000000">DNS</span>**<span style="color: #000000"> tab, and then click the </span>**<span style="color: #000000">Members</span>**<span style="color: #000000"> tab -> </span>*<span style="color: #000000">member</span>*<span style="color: #000000"> checkbox -> Edit icon.</span>
2. <span style="color: #000000">In the </span>*<span style="color: #000000">Grid</span>*<span style="color: #000000"> </span>*<span style="color: #000000">DNS</span>*<span style="color: #000000"> </span>*<span style="color: #000000">Properties</span>*<span style="color: #000000"> or </span>*<span style="color: #000000">Member</span>*<span style="color: #000000"> </span>*<span style="color: #000000">DNS</span>*<span style="color: #000000"> </span>*<span style="color: #000000">Properties</span>*<span style="color: #000000"> editor, click </span>**<span style="color: #000000">Toggle</span>**<span style="color: #000000"> </span>**<span style="color: #000000">Advanced</span>**<span style="color: #000000"> </span>**<span style="color: #000000">Mode</span>**<span style="color: #000000"> and then select the </span>**<span style="color: #000000">Logging</span>**<span style="color: #000000"> tab.</span>
3. <span style="color: #000000">Select the </span>**<span style="color: #000000">Queries</span>**<span style="color: #000000"> checkbox to start capturing DNS queries. When you enable this option at the member level, NIOS captures DNS queries for only the selected member.</span>
4. <span style="color: #000000">Select the </span>**<span style="color: #000000">Responses</span>**<span style="color: #000000"> checkbox to start capturing DNS responses. When you enable this option at the member level, NIOS captures DNS responses for only the selected member.</span>
5. <span style="color: #000000">In the </span>**<span style="color: #000000">DNSTAP Receiver Address</span>**<span style="color: #000000"> field, enter the IP address from which you want to capture queries or responses. It supports both IPv4 and IPv6 addresses.</span>
6. <span style="color: #000000">In the </span>**<span style="color: #000000">DNSTAP Receiver Port field,</span>**<span style="color: #000000"> enter the port number on which you want to configure the dnstap client system. The default port number is 6000. </span>
7. <span style="color: #000000">Click </span>**<span style="color: #000000">Save and Close</span>**<span style="color: #000000">.</span>

<span style="color: #000000">Infoblox recommends the configurations in the following table to meet high-performance query logging using the dnstap log format:</span>

| **<span style="color: #000000">Feature</span>** | **<span style="color: #000000">Total CPU</span>** | **<span style="color: #000000">Total Virtual Memory </span>**  
**<span style="color: #000000">(without Advanced DNS Protection software)</span>** | **<span style="color: #000000">Total Virtual Memory</span>**  
**<span style="color: #000000">(with Advanced DNS Protection software)</span>** | **<span style="color: #000000">Database Object Count </span>** | **<span style="color: #000000">Grid Master Capable</span>**<span style="color: #000000">** **</span> |
| --- | --- | --- | --- | --- | --- |
| <span style="color: #000000">Small recursive DNS (with acceleration)</span> | <span style="color: #000000">10</span> | <span style="color: #000000">16</span> | <span style="color: #000000">24</span> | <span style="color: #000000">100,000</span> | <span style="color: #000000"> No</span> |
| <span style="color: #000000">Medium recursive DNS (with acceleration)</span> | <span style="color: #000000">16</span> | <span style="color: #000000">24</span> | <span style="color: #000000">32</span> | <span style="color: #000000">100,000</span> | <span style="color: #000000">No</span> |
| <span style="color: #000000">Large recursive DNS (with acceleration)</span> | <span style="color: #000000">26</span> | <span style="color: #000000">34</span> | <span style="color: #000000">42</span> | <span style="color: #000000">100,000</span> | <span style="color: #000000">No</span> |


> Macro (__confluenceADFMigrationUnsupportedContentInternalExtension__)