Thanks! I pretty much did this as a learning/hobby side project. Back in 2021, I was dealing with a lot of K8s clusters and had recently learnt what about ndots[1]. That prompted me to build an easy to use DNS client which can avoid surprises about the host environment.
I've built this using Go, my daily driver. It doesn't use any CLI frameworks, that was mostly out of choice as I didn't want to add external deps unless really required.
My favourite part was to build this small help.go[3] utility which renders colored/formatted help text. Over the time I got some good quality external contributions, especially the one from @jedisct1 for adding DNSCrypt[2] support to it. Releasing a v1.0 has been on the back burner forever (like, a whole year+ :'). Life, other projects, and probably a bit of procrastination got in the way.
Finally sat down last week and forced myself to come up with a deadline to push this out. [1]: https://mrkaran.dev/posts/ndots-kubernetes/ [2]: https://github.com/mr-karan/doggo/pull/17 [3]: https://github.com/mr-karan/doggo/blob/main/cmd/help.go
I went to switch over to "dog" last week but it looks abandoned. I couldn't get a download to work because of outdated dependencies, and IIRC I couldn't get it to build, so I just gave up on it after seeing the latest release is 4 years old.
That seems crazy to me that a DNS client is broken after only 4 years due to incompatibility dependencies! I was going to suggest that maybe it's just completed software, but wow, this makes me really want to stay away from the Rust ecosystem.
Very nice to also have it dockerized. You might just want to add in the documentation the `--rm` parameter for cleanup after running and `-t` for the colors. So it will be
docker run --rm -it ghcr.io/mr-karan/doggo:latest mrkaran.dev MX
Long answer: Not OP, but sometimes you’re in a throwaway env and want to quickly do a DNS query and don’t have any tools (like Ubuntu minimal) available. Spawning an ephemeral container isn’t a bad idea in that case.
That's also where declarative package managers such as Nix and Guix shine. You can temporarily "install" packages that can be cleaned up later, garbage-collection style. Besides being their own distros, both can be used as add-on package managers on other Linux distros, for example.
You want an upfront assurance that there's not going to be any bullshit. There's nothing that technically prevents a docker container from failing, of course. But seeing that someone took the extra step to make one is enough assurance. And it also protects the author from incoming "it doesn't work on my machine" bs.
Which trouble? The image gets pulled once. Running it is pretty straightforward and fast enough. And not much work to clean up if you don’t use it. Beside that I don’t have to care about the right package manager.
But then I‘m also a person that prefers npx to global npm installs.
I have a silly question I guess... why does it print everything out twice?
~ doggo google.com NAME TYPE CLASS TTL ADDRESS NAMESERVER google.com. A IN 296s 142.250.67.14 127.0.2.2:53 google.com. A IN 296s 142.250.67.14 127.0.2.3:53 ~ doggo news.ycombinator.com NAME TYPE CLASS TTL ADDRESS NAMESERVER news.ycombinator.com. A IN 1s 209.216.230.207 127.0.2.2:53 news.ycombinator.com. A IN 1s 209.216.230.207 127.0.2.3:53
Would be useful in my unfortunate case where the ISP's DNS is broken for a bunch of domains. Most notably githubusercontent.com. Also a bunch of CDN domains.
Try a few queries to an anycasted resolver for the same record. It's rather common that, for example, TTL values differ per response. (the magic trick here is that it's not guaranteed that your requests end up on the same resolver).
You could have a look at https://dnsdiag.org/ that provides a few tools for further introspection in the many (different) answers resolvers can give.
Just tried on my Adguard DNS server, I am only getting one entry. I think it's related to your nameserver configuration. Could you try reproducing with specifying a custom one, with @1.1.1.1 or something?
Comments (122) 29 threads
I've built this using Go, my daily driver. It doesn't use any CLI frameworks, that was mostly out of choice as I didn't want to add external deps unless really required. My favourite part was to build this small help.go[3] utility which renders colored/formatted help text.
Over the time I got some good quality external contributions, especially the one from @jedisct1 for adding DNSCrypt[2] support to it.
Releasing a v1.0 has been on the back burner forever (like, a whole year+ :'). Life, other projects, and probably a bit of procrastination got in the way. Finally sat down last week and forced myself to come up with a deadline to push this out.
[1]: https://mrkaran.dev/posts/ndots-kubernetes/
[2]: https://github.com/mr-karan/doggo/pull/17
[3]: https://github.com/mr-karan/doggo/blob/main/cmd/help.go
[1] https://github.com/ogham/dog
Continue this thread — 1 reply
Short answer: Why not :)
It's a lot of code to "just run a UDP packet" IMHO.
~ doggo google.com
NAME TYPE CLASS TTL ADDRESS NAMESERVER
google.com. A IN 296s 142.250.67.14 127.0.2.2:53
google.com. A IN 296s 142.250.67.14 127.0.2.3:53
~ doggo news.ycombinator.com
NAME TYPE CLASS TTL ADDRESS NAMESERVER
news.ycombinator.com. A IN 1s 209.216.230.207 127.0.2.2:53
news.ycombinator.com. A IN 1s 209.216.230.207 127.0.2.3:53
You could have a look at https://dnsdiag.org/ that provides a few tools for further introspection in the many (different) answers resolvers can give.
All comments shown.
Couldn't load more comments. Check your connection and try again.