Introducing Doggo

I’ll take the opportunity of adding the first post to this new category :smiley:

A few months back I worked on a side project Doggo which is a command line DNS utility (much like dig). The output of dig is a bit noisy and the flag usage is not really straightforward (atleast without referring to Man pages). I use dig a lot at my work, and also happened to chance upon another project (written in Rust) dog, which was the primary motivation for me to write a similar tool in Golang.

It supports a wide range of DNS Transport protocols (DoH, DoT, DNSCrypt etc), colored output on Terminal, JSON reports etc.

It’s available as a Binary, Docker Image, REST API and a frontend tool as well (which @knadh helped me with) .

I’d love any kind of feedback + feature requests on this :slight_smile:



Going through the source code, it is very interesting to see how hard it is to find the system nameservers on windows.

Doggo seems to be working slighly differently compared to dog and dig when it comes to reading the system nameservers. Doggo seems to be picking all the entries while the other tools pick only the first one.

$ doggo
NAME           	TYPE	CLASS	TTL  	ADDRESS     	NAMESERVER	A   	IN   	2327s	A   	IN   	2568s

$ dog
A 37m48s

$ dig
...		2195	IN	A

On mac os x, when I remove all the name servers, the system replaces the nameservers with the nameserver from the DHCP. The nameserver that got are:

$ cat /etc/resolv.conf

The entry is an errounous entry coming from my router. That is breaking Doggo, but not the other tools. It may be because they are picking only the first entry.

$ doggo
ERROR[2021-05-17T20:19:20+05:30] error looking up DNS records                  
error="read udp> read: connection refused"

$ dog
A 32m23s

$ dig		1929	IN	A

Appaently, routers sending as nameserver is a well known issue and resolve.conf documentation suggest that it supports a name_server_blacklist field.


A list of name servers to be removed from consideration. The default is as some faulty
routers send it via DHCP. To remove a block, you can use 192.168.*

However, showing duplicate results for each system name server doesn’t sound like a good idea. The user is most likely to use the tool to troubleshoot a domain rather than nameserver. If it were the latter, there is always an option to specify the nameserver as command-line arguments.

What do you think?

1 Like

Yep, that’s intentional.

Hm, well I’ve had to actually deal with DNS server issues in the past and that’s why I thought it’ll be a nice idea to query a DNS record with all nameservers.

Just to illustrate a simple point where this could be useful, consider you’ve a Split DNS setup where a record like resolves to 2 different A records (on 2 different nameservers). Doing doggo would actually be beneficial here, since you could see both the records in one command.

Appaently, routers sending as nameserver is a well known issue and resolve.conf documentation suggest that it supports a name_server_blacklist field.

This is interesting, TIL :slight_smile:

However, I think I can push a patch for this, where doggo should not fail entirely if it failed for just one nameserver. I can probably silently fail in the default scenario, which will make it look like it works like dig/dog and if verbose mode is enabled, the user could see a proper error message. Does that sound fine?

Thanks for looking into this, appreciate your feedback!

1 Like

It was actually a simple fix in the codebase, that it doesn’t look like a legit fix :smiley:

How it behaves in case of an invalid entry in /etc/resolv.conf:

❯ ./bin/doggo-cli.bin
ERROR[2021-05-18T19:07:56+05:30] error looking up DNS records                  error="read udp> i/o timeout"
NAME            TYPE    CLASS   TTL     ADDRESS         NAMESERVER     A       IN      30s

I thought about silently failing, but I think verbose logging should actually be only for more verbose/debugging information, errors are not that.

And about picking up just one nameserver from the resolvconf, so dig actually tries to pick the second nameserver only if the first nameserver gave a SERVFAIL response.


❯ dig +noall +answer             48      IN      A

So despite the first entry being erroneous, it actually picked the second and resolved.

I’d say it’s useful, but honestly I don’t see a strong reason as to why doggo should follow the same approach. One downside I can see is that if you have 5 nameservers in your /etc/resolv.conf, each having a query timeout of 5s and let’s say 4 nameservers are down, then the minimum response time would be 20s…which can be quite irritating. But atleast doggo will show the problem with the nameserver, unlike dig which silently jumps to next good nameserver.

So I think weighing both sides, the current behaviour of doggo seems alright IMHO :slight_smile: