mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Add debug.Hexdump (#1902)
Allow plugins to dump messages in text pcap to the log. The forward plugin does this when a reply does not much the query. If the debug plugin isn't loaded Hexdump and Hexdumpf are noop. Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -10,7 +10,7 @@ Normally CoreDNS will recover from panics, using *debug* inhibits this. The main
|
||||
to help testing. A side effect of using *debug* is that `log.Debug` and `log.Debugf` will be printed
|
||||
to standard output.
|
||||
|
||||
Note that the *errors* plugin (if loaded) will also set a `recover` negating this setting.
|
||||
Note that the *errors* plugin (if loaded) will also set a `recover` negating this setting.
|
||||
|
||||
## Syntax
|
||||
|
||||
@@ -18,6 +18,21 @@ Note that the *errors* plugin (if loaded) will also set a `recover` negating thi
|
||||
debug
|
||||
~~~
|
||||
|
||||
Some plugin will debug log DNS messages. This is done in the following format:
|
||||
|
||||
~~~
|
||||
debug: 000000 00 0a 01 00 00 01 00 00 00 00 00 01 07 65 78 61
|
||||
debug: 000010 6d 70 6c 65 05 6c 6f 63 61 6c 00 00 01 00 01 00
|
||||
debug: 000020 00 29 10 00 00 00 80 00 00 00
|
||||
debug: 00002a
|
||||
~~~
|
||||
|
||||
Using `text2pcap` (part of Wireshark) this can be converted back to binary, with the following
|
||||
command line: `text2pcap -i 17 -u 53,53`. Where 17 is the protocol (UDP) and 53 are the ports. These
|
||||
ports allow wireshark to detect these packets as DNS messages.
|
||||
|
||||
Each plugin can decide to dump messages to aid in debugging.
|
||||
|
||||
## Examples
|
||||
|
||||
Disable the ability to recover from crashes and show debug logging:
|
||||
@@ -27,3 +42,7 @@ Disable the ability to recover from crashes and show debug logging:
|
||||
debug
|
||||
}
|
||||
~~~
|
||||
|
||||
## Also See
|
||||
|
||||
https://www.wireshark.org/docs/man-pages/text2pcap.html.
|
||||
|
||||
Reference in New Issue
Block a user