• Stars
    star
    1,639
  • Rank 28,521 (Top 0.6 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created almost 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A tiny command line DNS client with support for UDP, TCP, DoT, DoH, DoQ and ODoH.

q

A tiny and feature-rich command line DNS client with support for UDP, TCP, DoT, DoH, DoQ, and ODoH.

Release Coverage Go Report License

q screenshot

Examples

q example.com                            Lookup default records for a domain
q example.com MX SOA                     ...or specify a list of types

q example.com MX @9.9.9.9                Query a specific server
q example.com MX @https://dns.quad9.net  ...over HTTPS (or TCP, TLS, QUIC, or ODoH)...
q @sdns://AgcAAAAAAAAAAAAHOS45LjkuOQA    ...or from a DNS Stamp

q example.com MX --format=raw            Output in raw (dig) format
q example.com MX --format=json           ...or as JSON (or YAML)

Usage

Usage:
  q [OPTIONS] [@server] [type...] [name]

All long form (--) flags can be toggled with the dig-standard +[no]flag notation.

Application Options:
  -q, --qname=                 Query name
  -s, --server=                DNS server
  -t, --type=                  RR type (e.g. A, AAAA, MX, etc.) or type integer
  -x, --reverse                Reverse lookup
  -d, --dnssec                 Set the DO (DNSSEC OK) bit in the OPT record
  -n, --nsid                   Set EDNS0 NSID opt
      --subnet=                Set EDNS0 client subnet
  -c, --chaos                  Use CHAOS query class
  -C=                          Set query class (default: IN 0x01) (default: 1)
  -p, --odoh-proxy=            ODoH proxy
      --timeout=               Query timeout (default: 10s)
      --pad                    Set EDNS0 padding
      --http3                  Use HTTP/3 for DoH
      --no-id-check            Disable checking of DNS response ID
      --no-reuse-conn          Use a new connection for each query
      --txtconcat              Concatenate TXT responses
      --recaxfr                Perform recursive AXFR
  -f, --format=                Output format (pretty, json, yaml, raw) (default: pretty)
      --pretty-ttls            Format TTLs in human readable format (default: true)
      --color                  Enable color output
      --question               Show question section
      --answer                 Show answer section (default: true)
      --authority              Show authority section
      --additional             Show additional section
  -S, --stats                  Show time statistics
      --all                    Show all sections and statistics
  -w                           Resolve ASN/ASName for A and AAAA records
  -r, --value                  Show record values only
      --aa                     Set AA (Authoritative Answer) flag in query
      --ad                     Set AD (Authentic Data) flag in query
      --cd                     Set CD (Checking Disabled) flag in query
      --rd                     Set RD (Recursion Desired) flag in query (default: true)
      --ra                     Set RA (Recursion Available) flag in query
      --z                      Set Z (Zero) flag in query
      --t                      Set TC (Truncated) flag in query
  -i, --tls-no-verify          Disable TLS certificate verification
      --tls-server-name=       TLS server name for host verification
      --tls-min-version=       Minimum TLS version to use (default: 1.0)
      --tls-max-version=       Maximum TLS version to use (default: 1.3)
      --tls-next-protos=       TLS next protocols for ALPN
      --tls-cipher-suites=     TLS cipher suites
      --http-user-agent=       HTTP user agent
      --http-method=           HTTP method (default: GET)
      --quic-alpn-tokens=      QUIC ALPN tokens (default: doq, doq-i11)
      --quic-no-pmtud          Disable QUIC PMTU discovery
      --quic-no-length-prefix  Don't add RFC 9250 compliant length prefix
      --default-rr-types=      Default record types (default: A, AAAA, NS, MX, TXT, CNAME)
      --udp-buffer=            Set EDNS0 UDP size in query (default: 1232)
  -v, --verbose                Show verbose log messages
      --trace                  Show trace log messages
  -V, --version                Show version and exit

Help Options:
  -h, --help                   Show this help message

Demo

asciicast

Protocol Support

Installation

q is available in binary form from:

To install q from source:

git clone https://github.com/natesales/q && cd q
go install

# Without debug information
go install -ldflags="-s -w -X main.version=release"

Server Selection

q will use a server from the following sources, in order:

  1. @server argument (e.g. @9.9.9.9 or @https://dns.google/dns-query)
  2. Q_DEFAULT_SERVER environment variable
  3. /etc/resolv.conf

TLS Decryption

q supports TLS decryption through a key log file generated when the SSLKEYLOGFILE environment variable is set to the absolute path of a writable file.

The generated file may be used by Wireshark to decipher the captured traffic.

Feature Comparison

DNS Transport Protocols

Protocol q doggo dog kdig dig drill
RFC 1034 UDP/TCP + + + + + +
RFC 7858 DNS over TLS + + + + - -
RFC 8484 DNS over HTTPS + + + + - -
RFC 9250 DNS over QUIC + + - - - -
RFC 9230 Oblivious DNS over HTTPS + - - - - -

Output Formats

Format q doggo dog kdig dig drill
Raw (dig-style) + - + + + +
Pretty colors + + + - - -
JSON + + + - - -
YAML + - - - + -

Output Flags

Option q doggo dog kdig dig drill
Toggle question section + - - + + -
Toggle answer section + - - + + -
Toggle authority section + - - + + -
Toggle additional section + - - + + -
Show query time + - - + + -

Query Flags

Flag q doggo dog kdig dig drill
AA + - + + + +
AD + - + + + +
CD + - + + + +
RD + - - + + +
Z + - - + + -
DO + - + + + +
TC + - - + + +

Protocol Tweaks

Flag q doggo dog kdig dig drill
HTTP Method + - - - - -
QUIC ALPN Tokens + - - - - -
QUIC toggle PMTU discovery + - - - - -
QUIC timeouts (dial and idle) + - - - - -
TLS handshake timeout + - - - - -

More Repositories

1

pathvector

Declarative routing platform that automates BGP route optimization and control plane configuration with secure and repeatable routing policy.
Go
209
star
2

openreactor

Open-source IEC nuclear fusion reactor: control, monitoring, and data logging system
Go
31
star
3

loa-generator

Quickly generate IP LoAs in your browser
JavaScript
16
star
4

doqd

DNS over QUIC implementation in Go (draft-ietf-dprive-dnsoquic-02)
Go
14
star
5

repo

My software repositories
Ruby
10
star
6

stping

Ping from multiple source IP simultaneously
Go
7
star
7

xdprtr

XDP programmable forwarding plane
C
7
star
8

zsh-bird-completions

ZSH Completion for the BIRD routing daemon
Shell
6
star
9

libvirt-sshd

SSH into a libvirt qemu VM serial console
Go
5
star
10

as112

AS112 DNS Service
Shell
5
star
11

OpenENDEC

Open source digital "ENDEC" Emergeny Alert System Controller
Python
4
star
12

go-bird

Go interface for BIRD2
Go
4
star
13

logknife

Remove sensitive information from logs
Go
4
star
14

natesales

3
star
15

sfptpd-exporter

Export sfptpd metrics to Prometheus
Go
3
star
16

bird-flowspec-daemon

Proof of concept for using BIRD+linux to act upon BGP flowspec routes
Go
3
star
17

delivr-old

CSS
2
star
18

libvirt-hostd

HTTP RPC API for libvirt
Go
2
star
19

pve-sshpty

SSH into a Proxmox VM's serial console
2
star
20

chat

SocketIO Chat App
HTML
2
star
21

gpsd-exporter

Export gpsd metrics to Prometheus
Go
2
star
22

aarch64-client-go

Go API client for aarch64.com
Go
2
star
23

rapidtemplate

A small, server-agnostic, Markdown to HTML templating application written in Go.
Go
2
star
24

aarch64-client-python

Python API client for aarch64.com
Python
2
star
25

pathvector-portal

BGP peering portal for Pathvector
Go
2
star
26

bifocal

Distributed network monitoring with the NLNOG RING
Go
1
star
27

bgp-resume

Arbitrary data transmission over the DFZ: How I'm storing my resume in your router's BGP table.
Go
1
star
28

ansible-module-aarch64-vm

Ansible Module for Fosshost aarch64 VM Management
Python
1
star
29

arix-website

https://arix.dev/
Svelte
1
star
30

picoENDEC

A small, lightweight, software ENDEC for the OpenENDEC project
Python
1
star
31

go-verfploeter

Go
1
star
32

vybgp

VyOS BGP Portal
HTML
1
star
33

bunnyfms

Lightweight FRC field management system
Go
1
star
34

vela

A modern userspace pseudowire protocol
Go
1
star
35

bcg-exporter

Export bcg statistics to Prometheus
Go
1
star
36

fosshost-dashboard

CSS
1
star
37

avian

Python
1
star
38

peerlockdb

Svelte
1
star
39

peeringdb-cache

PeeringDB cache with drop-in replacement API
Python
1
star
40

bgptools-go

Go interface for bgp.tools WHOIS interface
Go
1
star