• Stars
    star
    3,034
  • Rank 14,872 (Top 0.3 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created almost 4 years ago
  • Updated about 2 months ago

Reviews

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

Repository Details

🐶 Command-line DNS Client for Humans. Written in Golang

doggo

🐶 Command-line DNS client for humans
doggo.mrkaran.dev

doggo CLI usage


doggo is a modern command-line DNS client (like dig) written in Golang. It outputs information in a neat concise manner and supports protocols like DoH, DoT, DoQ, and DNSCrypt as well.

It's totally inspired from dog which is written in Rust. I wanted to add some features to it but since I don't know Rust, I found it as a nice opportunity to experiment with writing a DNS Client from scratch in Go myself. Hence the name dog +go => doggo.

Features

  • Human readable output - supports colors and tabular format.
  • Supports JSON format - can be useful while writing scripts.
  • Has support for multiple transport protocols:
    • DNS over HTTPS (DoH)
    • DNS over TLS (DoT)
    • DNS over QUIC (DoQ)
    • DNS over TCP
    • DNS over UDP
    • DNS over DNSCrypt
  • Supports ndots and search configurations from resolv.conf or command-line arguments.
  • Supports multiple resolvers at once.
  • Supports IPv4 and IPv6 both.
  • Available as a web tool as well: https://doggo.mrkaran.dev.
  • Shell completions for zsh and fish.
  • Reverse DNS Lookups.

Installation

Binary

You can grab the latest binaries for Linux, MacOS and Windows from the Releases section.

For eg, to pull the latest linux-amd64 binary:

$ cd "$(mktemp -d)"
$ curl -sL "https://github.com/mr-karan/doggo/releases/download/v0.3.7/doggo_0.3.7_linux_amd64.tar.gz" | tar xz
$ mv doggo /usr/local/bin
# doggo should be available now in your $PATH
$ doggo

Docker

Images are hosted on Github Container Registry (ghcr.io). You can view all the tags here. It even supports ARM so you can spin up a container on your RPi to do DNS lookups, cause why not.

Pull

docker pull ghcr.io/mr-karan/doggo:latest

Running

You can supply all arguments to the CLI directly to docker run command. Eg:

docker run ghcr.io/mr-karan/doggo:latest mrkaran.dev @1.1.1.1 MX

Package Managers

Homebrew

Install via Homebrew

$ brew install doggo

Arch

yay -S doggo-bin

Scoop

Install via Scoop

scoop install doggo

From Source

You need to have go installed in your system.

$ go install github.com/mr-karan/doggo/cmd/doggo@latest

The binary will be available at $GOPATH/bin/doggo.

Usage Examples

Do a simple DNS Lookup for mrkaran.dev

$ doggo mrkaran.dev                                                                         
NAME            TYPE    CLASS   TTL     ADDRESS         NAMESERVER   
mrkaran.dev.    A       IN      20s     13.250.205.9    127.0.0.1:53
mrkaran.dev.    A       IN      20s     206.189.89.118  127.0.0.1:53

Query MX records for github.com using 9.9.9.9 resolver

doggo MX github.com @9.9.9.9
NAME            TYPE    CLASS   TTL     ADDRESS                         NAMESERVER 
github.com.     MX      IN      3600s   10 alt3.aspmx.l.google.com.     9.9.9.9:53
github.com.     MX      IN      3600s   5 alt1.aspmx.l.google.com.      9.9.9.9:53
github.com.     MX      IN      3600s   10 alt4.aspmx.l.google.com.     9.9.9.9:53
github.com.     MX      IN      3600s   5 alt2.aspmx.l.google.com.      9.9.9.9:53
github.com.     MX      IN      3600s   1 aspmx.l.google.com.           9.9.9.9:53

or using named parameters:

$ doggo -t MX -n 9.9.9.9 github.com
NAME            TYPE    CLASS   TTL     ADDRESS                         NAMESERVER 
github.com.     MX      IN      3600s   10 alt3.aspmx.l.google.com.     9.9.9.9:53
github.com.     MX      IN      3600s   5 alt1.aspmx.l.google.com.      9.9.9.9:53
github.com.     MX      IN      3600s   10 alt4.aspmx.l.google.com.     9.9.9.9:53
github.com.     MX      IN      3600s   5 alt2.aspmx.l.google.com.      9.9.9.9:53
github.com.     MX      IN      3600s   1 aspmx.l.google.com.           9.9.9.9:53

Query DNS records for archive.org using Cloudflare DoH resolver

$ doggo archive.org @https://cloudflare-dns.com/dns-query 
NAME            TYPE    CLASS   TTL     ADDRESS         NAMESERVER                           
archive.org.    A       IN      41s     207.241.224.2   https://cloudflare-dns.com/dns-query

Query DNS records for internetfreedom.in with JSON output

$ doggo internetfreedom.in --json | jq
{
  "responses": {
    "answers": [
      {
        "name": "internetfreedom.in.",
        "type": "A",
        "class": "IN",
        "ttl": "22s",
        "address": "104.27.158.96",
        "rtt": "37ms",
        "nameserver": "127.0.0.1:53"
      },
      {
        "name": "internetfreedom.in.",
        "type": "A",
        "class": "IN",
        "ttl": "22s",
        "address": "104.27.159.96",
        "rtt": "37ms",
        "nameserver": "127.0.0.1:53"
      },
      {
        "name": "internetfreedom.in.",
        "type": "A",
        "class": "IN",
        "ttl": "22s",
        "address": "172.67.202.77",
        "rtt": "37ms",
        "nameserver": "127.0.0.1:53"
      }
    ],
    "queries": [
      {
        "name": "internetfreedom.in.",
        "type": "A",
        "class": "IN"
      }
    ]
  }
}

Query DNS records for duckduckgo.com and show RTT (Round Trip Time)

$ doggo duckduckgo.com --time                
NAME            TYPE    CLASS   TTL     ADDRESS         NAMESERVER      TIME TAKEN 
duckduckgo.com. A       IN      30s     40.81.94.43     127.0.0.1:53    45ms      

Command-line Arguments

Transport Options

URL scheme of the server is used to identify which resolver to use for lookups. If no scheme is specified, defaults to udp.

  @udp://        eg: @1.1.1.1 initiates a UDP resolver for 1.1.1.1:53.
  @tcp://        eg: @1.1.1.1 initiates a TCP resolver for 1.1.1.1:53.
  @https://      eg: @https://cloudflare-dns.com/dns-query initiates a DOH resolver for Cloudflare DoH server.
  @tls://        eg: @1.1.1.1 initiates a DoT resolver for 1.1.1.1:853.
  @sdns://       eg: @sdns://AgcAAAAAAAAABzEuMC4wLjEAEmRucy5jbG91ZGZsYXJlLmNvbQovZG5zLXF1ZXJ5
                 initiates a DNSCrypt or DoH resolver using its DNS stamp.
  @quic://       eg: @quic://dns.adguard.com
                 initiates a DNS over QUIC resolver for Adguard DNS Resolver.

Query Options

  -q, --query=HOSTNAME        Hostname to query the DNS records for (eg mrkaran.dev).
  -t, --type=TYPE             Type of the DNS Record (A, MX, NS etc).
  -n, --nameserver=ADDR       Address of a specific nameserver to send queries to (9.9.9.9, 8.8.8.8 etc).
  -c, --class=CLASS           Network class of the DNS record (IN, CH, HS etc).

Resolver Options

  --strategy=STRATEGY           Specify strategy to query nameserver listed in etc/resolv.conf. Defaults to `all` (`random`, `first`, `all`).
  --ndots=INT                   Specify ndots parameter. Takes value from /etc/resolv.conf if using the system nameserver or 1 otherwise.
  --search                      Use the search list defined in resolv.conf. Defaults to true. Set --search=false to disable search list.
  --timeout                     Specify timeout (in seconds) for the resolver to return a response.
  -4 --ipv4                     Use IPv4 only.
  -6 --ipv6                     Use IPv6 only.
  --tls-hostname=HOSTNAME       Provide a hostname for doing verification of the certificate if the provided DoT nameserver is an IP.
  --skip-hostname-verification  Skip TLS Hostname Verification in case of DOT Lookups.

Output Options

  -J, --json                  Format the output as JSON.
  --color                     Defaults to true. Set --color=false to disable colored output.
  --debug                     Enable debug logging.
  --time                      Shows how long the response took from the server.
  --short                     Short output format. Shows only the response section.

Contributing

I'm open to accept feature requests and/or issues. I understand doggo is a new DNS Client in the town and there might be some edge cases I am not handling. Please feel free to open issues if you ever come across such a case. For now I am focussing more on planned features for a stable v1.0 release soon.

License

LICENSE

More Repositories

1

awesome-investing

💸💸 Curated list of investment & finance related resources
1,902
star
2

swiggy-analytics

Analyse your swiggy orders 🍔
Python
271
star
3

homelab

Infra-as-code for my personal home server setup
HTML
254
star
4

barreldb

A disk based KV store (based on Bitcask implementation)
Go
166
star
5

kubekutr

Cookie cutter templating tool for scaffolding K8s manifests
Go
159
star
6

calert

🔔 Send alert notifications to Google Chat via Prometheus Alertmanager
Go
153
star
7

gullak

A no-frills expense tracker app enabling quick logging of expenses in natural language, using LLMs for parsing and categorization.
Vue
75
star
8

monkeybeat

Generate a random stock portfolio and find out if it beats the markets!
Go
64
star
9

nomad-monitoring

Collection of jobspecs and Grafana dashboards for end to end monitoring of Nomad clusters
HCL
53
star
10

nomad-vector-logger

A daemon which continuously watches jobs running in a Nomad cluster and templates out a Vector configuration file which can be used to collect application logs enriched with Nomad metadata.
Go
53
star
11

webkin

💻 CLI tool to send webpages to kindle. 📔
Python
50
star
12

nomad-events-sink

An events collection agent which processes Nomad Events and dumps to external sink providers like HTTP
Go
49
star
13

nomctx

Faster way to switch between clusters and namespaces in nomad
Go
47
star
14

flexit

Responsive grid based on CSS Flexbox
HTML
45
star
15

notes

Collection of my byte sized notes on programming and other random topics.
Makefile
37
star
16

nomad-external-dns

Set external DNS records for Nomad services
Go
36
star
17

cloak

Securely share sensitive text with others
Go
33
star
18

store-exporter

Utility to extract metrics from arbitary data stores in Prometheus format
Go
32
star
19

clickhouse-keeper-example

Setup ClickHouse cluster with replication using `clickhouse-keeper`
Makefile
30
star
20

website

Personal site, made using Zola
HTML
30
star
21

fate

Browse FontAawesome icons from your shell
Python
29
star
22

coredns-nomad

Go
29
star
23

terraform-provider-kite

Terraform provider for managing long term portfolio with Zerodha Kite
Go
24
star
24

Insta-notFollow

A Flask web app to find out people whom you follow on Instagram but they don't follow you back 😈
HTML
22
star
25

toru

Toru is a Go module proxy with caching and rewrite capabilities
Go
22
star
26

balance

Minimal Golang library for implemeting weighted round robin load balancing.
Go
21
star
27

1brc-go

1️⃣🐝🏎️ The One Billion Row Challenge -- A fun exploration of how quickly 1B rows from a text file can be aggregated with Golang
Go
16
star
28

clx

Generate CLI commands using AI for common ops
Go
16
star
29

haraka-plugin-outbound-logger

Haraka SMTP plugin for logging outbound traffic. Useful for storing audit information of delivered/bounced emails.
JavaScript
15
star
30

nomcfg

HTML
15
star
31

kiteHistory

🤑 Kite History API wrapper
Python
14
star
32

vscode-kite

Visual Studio Code extension for KiteConnect API
JavaScript
13
star
33

kite-yoda

Ignorance is bliss.
JavaScript
12
star
34

k8s-deployment-book

⭐ Kubernetes - Production Deployments for Developers (Book) ⭐
HTML
12
star
35

nomadev

Docker based development workflow with Nomad and Consul
Dockerfile
12
star
36

simplehealth

Tiny lib for exposing health-check endpoints as Prometheus/JSON format
Go
11
star
37

localhashi

Vagrant based setup for local Nomad/Consul clusters. Helpful for experimenting with Nomad job specs in an environment similar to production.
Jinja
10
star
38

junbi

Shell
9
star
39

ebs-snapshot-exporter

Export AWS EBS Snapshots data as Prometheus metrics
Go
8
star
40

kong-service-exporter

Utility to create a export a service registry Markdown file from Kong's config
Python
8
star
41

alertmatter

Alertmanager - Mattermost Webhook Receiver
Go
7
star
42

calwarrior

Calendar web view for Takwarrior
Vue
7
star
43

NoiseInspector

📢 Arduino + Python + ESP8266 Wifi = Noise Level Monitor
Arduino
7
star
44

ansible-server-logs-monitoring

Ansible playbook to install ELK stack for log analysis and Prometheus/AlertManager/Node Exporter/Grafana for Server monitoring. Or as they say, One 💍 to rule them all!
7
star
45

eks-gitops

Set of utilities to do deployments in an EKS cluster
Dockerfile
6
star
46

caddy-plugins-docker

Docker image for Caddy with custom plugins baked into the image.
Dockerfile
5
star
47

haraka-docker

Docker image for Haraka SMTP server
Dockerfile
5
star
48

listmonk-infra

Source code for deploying listmonk on Kubernetes
Makefile
4
star
49

mfp-calorie-extract

Copy macronutrients information from MFP and paste them in Google Sheets for calorie tracking
JavaScript
4
star
50

cgroup-stats

Tiny Go library designed for retrieving CPU and Memory quota information from Linux control groups (cgroups).
Go
4
star
51

pinkFloyd-Lyrics

Analyzing Pink Floyd lyrics
HTML
4
star
52

SNUMessApp

Android App for SNU Weekly Mess Menu
Jupyter Notebook
3
star
53

notion-weightbot

A Telegram bot which tracks bodyweight and stores the records in a Notion Database and CSV
Go
3
star
54

fritter

Know if it's a good time to call your posh NRI fraands
Go
2
star
55

k8s-pruner

Cleanup unused configmaps in a Kubernetes namespace
Shell
2
star
56

talks

HTML
2
star
57

NetNeutralityBadge

Add SaveTheInternet Badge to your Facebook DP to show support for Net Neutrality
HTML
2
star
58

vscode-nomfmt

Visual Studio Code extension for on-the-fly formatting of Nomad job specs in HCL using `nomad fmt`.
TypeScript
1
star
59

Algorithm-Implementations--Python

Some Implementations of Algorithms in Python
Python
1
star
60

aws-dc-exporter

Prometheus metrics exporter for AWS Direct Connect
Go
1
star
61

kong-ansible

Ansible Playbook for setting up Kong node and using Cassandra as datastore
1
star
62

koanf-test

Go
1
star
63

rubberduck

Toolbox of useful utilities for debugging inside Containers
Go
1
star
64

Python-Scripts

Writing Python Scripts to do boring monotonous work the fun way :D
Python
1
star
65

telegramBot-YtDownload

Telegram Bot which downloads Youtube videos
Python
1
star
66

newsletter

HTML
1
star
67

weather-Twitter-Bot

Made a Weather Twitter Bot using Python
Python
1
star
68

HackerRank-Problems

My codes for some problems on HackerRank : https://www.hackerrank.com/domains/miscellaneous/python-tutorials
Python
1
star
69

khoj

CSE SNU Project Final Year
Python
1
star