Skip to content

Instantly share code, notes, and snippets.

@edmonds
edmonds / dnstap.txt
Last active February 29, 2024 16:55
example formatted output from dnstap command-line tool
21:08:07.858612 CQ 127.0.0.1 UDP 40b "dnstap.info." IN A
21:08:07.858604 RQ 192.5.5.241 UDP 28b "." IN NS
21:08:07.872825 RR 192.5.5.241 UDP 857b "." IN NS
21:08:07.872825 RQ 192.5.5.241 UDP 40b "dnstap.info." IN A
21:08:07.901990 RR 192.5.5.241 UDP 686b "dnstap.info." IN A
21:08:07.901990 RQ 199.254.49.1 UDP 40b "dnstap.info." IN A
21:08:07.964484 RR 199.254.49.1 UDP 596b "dnstap.info." IN A
21:08:07.964484 RQ 192.5.5.241 UDP 48b "ns7.dnsmadeeasy.com." IN AAAA
21:08:07.964484 RQ 192.5.5.241 UDP 48b "ns7.dnsmadeeasy.com." IN A
21:08:07.979984 RR 192.5.5.241 UDP 743b "ns7.dnsmadeeasy.com." IN AAAA
@edmonds
edmonds / dnstap.out.txt
Created February 12, 2014 17:33
dnstap.info/Tutorials/NANOG60
12:26:41.642941 CQ 127.0.0.1 UDP 40b "dnstap.info." IN A
12:26:41.642927 RQ 192.5.5.241 UDP 28b "." IN NS
12:26:41.712134 RR 192.5.5.241 UDP 857b "." IN NS
12:26:41.712134 RQ 192.5.5.241 UDP 40b "dnstap.info." IN A
12:26:41.779511 RR 192.5.5.241 UDP 686b "dnstap.info." IN A
12:26:41.779511 RQ 199.254.31.1 UDP 40b "dnstap.info." IN A
12:26:41.798161 RR 199.254.31.1 UDP 596b "dnstap.info." IN A
12:26:41.798161 RQ 192.5.5.241 UDP 48b "ns6.dnsmadeeasy.com." IN AAAA
12:26:41.798161 RQ 192.5.5.241 UDP 48b "ns6.dnsmadeeasy.com." IN A
12:26:41.864527 RR 192.5.5.241 UDP 743b "ns6.dnsmadeeasy.com." IN AAAA

Keybase proof

I hereby claim:

  • I am edmonds on github.
  • I am edmonds (https://keybase.io/edmonds) on keybase.
  • I have a public key whose fingerprint is DF3D 96EE B382 7820 F302 665C 0181 7AB0 AAF6 CDAE

To claim this, I am signing this object:

#!/usr/bin/env python
import struct
CONTROL_ACCEPT = 0x01
CONTROL_START = 0x02
CONTROL_STOP = 0x03
CONTROL_FIELD_CONTENT_TYPE = 0x01
read http://farsightsec.github.io/fstrm/group__fstrm__control.html first!
run fstrm_capture at a high debugging level to dump control frame details, and
send it some data:
$ fstrm_capture -d -d -d -d -d -t protobuf:dnstap.Dnstap -u /tmp/dnstap.sock -w /tmp/dnstap.out
fstrm_capture: opening Unix socket path /tmp/dnstap.sock
fstrm_capture: opened output file /tmp/dnstap.out
fstrm_capture: accepted new connection fd 8
fstrm_capture: connection fd 8: reading control frame (42 bytes): "\x00\x00\x00\x00\x00\x00\x00\"\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x16protobuf:dnstap.Dnstap"
edmonds@li:~$ dpkg -l knot-dnsutils
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-===========================================================
ii knot-dnsutils 2.7.6-2 amd64 Clients provided with Knot DNS (kdig, knslookup, knsupdate)
edmonds@li:~$ kdig --version
kdig (Knot DNS), version 2.7.6
edmonds@li:~$ kdig @dot.xfinity.com www.ietf.org +tls +dnssec -4 -E /tmp/dnstap.out.4 1>/dev/null
edmonds@li:~$ kdig @dot.xfinity.com www.ietf.org +tls +dnssec -6 -E /tmp/dnstap.out.6 1>/dev/null
edmonds@li:~$ dnstap-ldns -y -r /tmp/dnstap.out.4
type: MESSAGE
version: "kdig 2.7.6"
message:
type: TOOL_QUERY
query_time: !!timestamp 2019-10-29 00:43:32.083542
root@chase:~# dmesg -T | grep 'Wed Jan 22 16:06:49 2020'
[Wed Jan 22 16:06:49 2020] usb 2-13: new full-speed USB device number 27 using xhci_hcd
[Wed Jan 22 16:06:49 2020] usb 2-13: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[Wed Jan 22 16:06:49 2020] usb 2-13: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Wed Jan 22 16:06:49 2020] usb 2-13: Product: FT232R USB UART
[Wed Jan 22 16:06:49 2020] usb 2-13: Manufacturer: FTDI
[Wed Jan 22 16:06:49 2020] usb 2-13: SerialNumber: A50285BI
[Wed Jan 22 16:06:49 2020] ftdi_sio 2-13:1.0: FTDI USB Serial Device converter detected
[Wed Jan 22 16:06:49 2020] usb 2-13: Detected FT232RL
[Wed Jan 22 16:06:49 2020] usb 2-13: FTDI USB Serial Device converter now attached to ttyUSB0
root@chase:~# /usr/local/ubxtool/ubxtool --galileo --gps --glonass --beidou --port /dev/ttyUSB0 --baud 38400 --ubxport=1 --rtscts=0 --debug --stdout
Wed, 22 Jan 2020 21:20:08 +0000 initFD()
Wed, 22 Jan 2020 21:20:08 +0000 initFD - open(/dev/ttyUSB0)
Wed, 22 Jan 2020 21:20:08 +0000 initFD - open successful
Wed, 22 Jan 2020 21:20:08 +0000 initFD - tty set
Timeout
Timeout
Timeout
Timeout
Timeout
root@chase:~# /usr/local/ubxtool/ubxtool --galileo --gps --glonass --beidou --port /dev/ttyUSB0 --baud 38400 --ubxport=1 --rtscts=0 --debug --stdout | ~edmonds/src/galmon/navdump
Wed, 22 Jan 2020 21:24:15 +0000 initFD()
Wed, 22 Jan 2020 21:24:15 +0000 initFD - open(/dev/ttyUSB0)
Wed, 22 Jan 2020 21:24:15 +0000 initFD - open successful
Wed, 22 Jan 2020 21:24:15 +0000 initFD - tty set
Wed, 22 Jan 2020 21:24:16 +0000 Read some init: 1 7
Timeout
Wed, 22 Jan 2020 21:24:18 +0000 Read some init: 1 59
Wed, 22 Jan 2020 21:24:19 +0000 Read some init: 1 7
Wed, 22 Jan 2020 21:24:19 +0000 Read some init: 2 21