Response filters

Response logger - DNS

This response filter simply logs the responses to the specified output, which can either be the standard log, using a specific logger name, or a file.

Parameters

None of the parameters are required. If none are specified, the logging will go to the standard log.

  • File name : if empty, then the logging will go to the standard log. If specified, the file will be created if necessary, and appended to.

  • Use timestamp in file name : if selected, and a file name is provided, then a timestamp will be added to the file name.

  • Logger name : if specified, the logging will be done using the specified logger.

  • Format: If specified, the format of the log entries. Available variables are $ts for the timestamp, $clientIp for the IP address of the client, $thread for the thread ID, and $message for the text of the log entry.

  • Answer types : a comma-separated list of types, for instance A,MX,PTR. This filter will be invoked only for packets with at least one answer, name server or additional record with one of these types.

  • Answer names : a comma-separated list of names, some of which can be regular expression if prefixed with regex: -- for instance: www.foo.com,regex:.+\.bar\.com (see the documentation on regular expressions for more details).If this is specified, then this filter will be invoked only for packets with at least one answer, name server or additional record matching one of these names or regular expressions.

  • Client IPs : (comma-separated strings or regular expressions) If specified, this filter will run only for requests and responses for the specified client addresses. Example: 12.34.56.78,0:0:0:0:0:0:0:1,regex:26:06:47:00.*

JavaScript response filter - DNS

This response filter passes the packet to arbitrary JavaScript code, which can do almost anything it wants to it. Keep in mind that the packet still needs to make sense to its destination!

Parameters

None of the parameters are required. If no parameters are specified, then this filter will be invoked for all request packets. You can specify a subset of the packets using the following parameters:

  • Answer types : a comma-separated list of types, for instance A,MX,PTR. This filter will be invoked only for packets with at least one answer, name server or additional record with one of these types.

  • Answer names : a comma-separated list of names, some of which can be regular expression if prefixed with regex: -- for instance: www.foo.com,regex:.+\.bar\.com (see the documentation on regular expressions for more details).If this is specified, then this filter will be invoked only for packets with at least one answer, name server or additional record matching one of these names or regular expressions.

  • Client IPs : (comma-separated strings or regular expressions) If specified, this filter will run only for requests and responses for the specified client addresses. Example: 12.34.56.78,0:0:0:0:0:0:0:1,regex:26:06:47:00.*

The JavaScript code can do whatever it wants to the packet -- see the API documentation for more details.