Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
263 changes: 109 additions & 154 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,159 +1,114 @@
<div align="center">
<h1>doge</h1>

doge is a fork of [dog](https://github.com/ogham/dog).

<!-- <a href="https://travis-ci.org/github/ogham/dog">
<img src="https://travis-ci.org/ogham/dog.svg?branch=master" alt="Build status" />
</a> -->

<a href="https://saythanks.io/to/Dj-Codeman">
<img src="https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg" alt="Say thanks!" />
</a>
<h1>DOGE</h1>

<p align="center">
<img src="https://img.shields.io/github/license/Dj-Codeman/doge?style=flat-square&logo=opensourceinitiative&logoColor=white&color=0080ff" alt="license">
<img href="https://saythanks.io/to/Dj-Codeman" src="https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg" alt="Say thanks!" />
<img src="https://img.shields.io/github/last-commit/Dj-Codeman/doge?style=flat-square&logo=git&logoColor=white&color=0080ff" alt="last-commit">
<img src="https://img.shields.io/github/languages/top/Dj-Codeman/doge?style=flat-square&color=0080ff" alt="repo-top-language">
<img src="https://img.shields.io/github/languages/count/Dj-Codeman/doge?style=flat-square&color=0080ff" alt="repo-language-count">
<p>
<p align="center">
<img src="https://img.shields.io/badge/YAML-CB171E.svg?style=flat-square&logo=YAML&logoColor=white" alt="YAML">
<img src="https://img.shields.io/badge/PowerShell-5391FE.svg?style=flat-square&logo=PowerShell&logoColor=white" alt="PowerShell">
<img src="https://img.shields.io/badge/Docker-2496ED.svg?style=flat-square&logo=Docker&logoColor=white" alt="Docker">
<img src="https://img.shields.io/badge/GitHub%20Actions-2088FF.svg?style=flat-square&logo=GitHub-Actions&logoColor=white" alt="GitHub%20Actions">
<img src="https://img.shields.io/badge/JSON-000000.svg?style=flat-square&logo=JSON&logoColor=white" alt="JSON">
<img src="https://img.shields.io/badge/Rust-000000.svg?style=flat-square&logo=Rust&logoColor=white" alt="Rust">
</p>
</div>

<img src="doge-screenshot.jpg" alt="A screenshot of dog making a DNS request">

<hr>

<div>
<h4>Doge <em>can</em> look up!</h4>
<p><strong>doge</strong> is a command-line DNS client, like <code>dig</code> forked from the amazing work done <a href="https://github.com/ogham/dog">here</a>. It has colourful output, understands normal command-line argument syntax, supports the DNS-over-TLS and DNS-over-HTTPS protocols, and can emit JSON. I believe this is an amazing project and should be improved on.</p>
</div>

<div>
<h2>Examples</h2>
<pre>
<code>doge example.net</code> Query a domain using default settings
<code>doge example.net MX</code> ...looking up MX records instead
<code>doge example.net MX @1.1.1.1</code> ...using a specific nameserver instead
<code>doge example.net MX @1.1.1.1 -T</code> ...using TCP rather than UDP
<code>doge exapple.net MX @1.1.1.1 -p 69</code> ...using a nonstandard port
<code>doge -q example.net -t MX -n 1.1.1.1 -T</code> As above, but using explicit arguments
</pre>

<h2>Command-line options</h2>
<div>
<h3>Query options</h3>
<pre>
<code>&lt;arguments&gt;</code> Human-readable host names, nameservers, types, or classes
<code>-q, --query=HOST</code> Host name or domain name to query
<code>-t, --type=TYPE</code> Type of the DNS record being queried (A, MX, NS...)
<code>-n, --nameserver=ADDR</code> Address of the nameserver to send packets to
<code>-p, --port=PORT</code> Port options for sending queries on nonstandard ports
<code>--class=CLASS</code> Network class of the DNS record being queried (IN, CH, HS)
</pre>
</div>

<div>
<h3>Sending options</h3>
<pre>
<code>--edns=SETTING Whether to OPT in to EDNS (disable, hide, show)
--txid=NUMBER Set the transaction ID to a specific value
-Z=TWEAKS Set uncommon protocol-level tweaks</code>
</pre>
</div>

<div>
<h3>Protocol options</h3>
<pre>
<code>-U, --udp Use the DNS protocol over UDP
-T, --tcp Use the DNS protocol over TCP
-S, --tls Use the DNS-over-TLS protocol
-H, --https Use the DNS-over-HTTPS protocol</code>
</pre>
</div>

<div>
<h3>Output options</h3>
<pre>
<code>-1, --short Short mode: display nothing but the first result
-J, --json Display the output as JSON
--color, --colour=WHEN When to colourise the output (always, automatic, never)
--seconds Do not format durations, display them as seconds
--time Print how long the response took to arrive</code>
</pre>
</div>
</div>

![A screenshot of dog making a DNS request](doge-screenshot.jpg)

---

Doge _can_ look up!

**doge** is a command-line DNS client, like `dig` forked from the amazing work done [here](https://github.com/ogham/dog).
It has colourful output, understands normal command-line argument syntax, supports the DNS-over-TLS and DNS-over-HTTPS protocols, and can emit JSON. I belive this is an amazing project and should be improved on.

## Examples

doge example.net Query a domain using default settings
doge example.net MX ...looking up MX records instead
doge example.net MX @1.1.1.1 ...using a specific nameserver instead
doge example.net MX @1.1.1.1 -T ...using TCP rather than UDP
doge exapple.net MX @1.1.1.1 -p 53 ...using a nonstandart port
doge -q example.net -t MX -n 1.1.1.1 -T As above, but using explicit arguments

---

## Command-line options

### Query options

<arguments> Human-readable host names, nameservers, types, or classes
-q, --query=HOST Host name or domain name to query
-t, --type=TYPE Type of the DNS record being queried (A, MX, NS...)
-n, --nameserver=ADDR Address of the nameserver to send packets to
-p, --port=PORT Port options for sending queries on nonstandart ports
--class=CLASS Network class of the DNS record being queried (IN, CH, HS)

### Sending options

--edns=SETTING Whether to OPT in to EDNS (disable, hide, show)
--txid=NUMBER Set the transaction ID to a specific value
-Z=TWEAKS Set uncommon protocol-level tweaks

### Protocol options

-U, --udp Use the DNS protocol over UDP
-T, --tcp Use the DNS protocol over TCP
-S, --tls Use the DNS-over-TLS protocol
-H, --https Use the DNS-over-HTTPS protocol
<!-- more options -->

### Output options

-1, --short Short mode: display nothing but the first result
-J, --json Display the output as JSON
--color, --colour=WHEN When to colourise the output (always, automatic, never)
--seconds Do not format durations, display them as seconds
--time Print how long the response took to arrive


---

## Installation

Currently:
To install dog, you can download a pre-compiled binary, or you can compile it from source. You _**may**_ be able to install dog using your OS’s package manager, depending on your platform.

Issues:
I am not a rust expert at all, Honestly I'm the opposite, just learning codding. I used [`dog`](https://github.com/ogham/dog) on my arch system and a few random *nix Laptops that I perpetually fix and break . As such part of this progect will be outside of my skill set or ability to work on currently.
For **Windows** I don't intende on installing windows 11 anytime soon, So I most likely won't be adding new windows features
For **Macos** Till i can afford to waste money on a mac, the workflow for building release packages is the only support macos is going to get
For **Docker**, This is magic as far as I'm concerned. While I learn the spells to use it in a meaningful way expect things to be broken

If any of these are things you want to see make a PR and I'll read and merge it, Be on the lookout for some potentially dumb questions from me.

### Packages

They exist now !!!

$ cargo install dns-doge
$ yay -S dns-doge
<h2>Installation</h2>
<div>
<h3>Current and Upcoming packages</h3>
<pre>
<code>Cargo: cargo install dns-doge
ArchLinux: yay -S dns_doge
Ubuntu/Debian: Comming Soon
RHEL/Fedora/Cenos: Publishing rpm</code>
</pre>

<!-- - For Homebrew on macOS, install the [`dog`](https://formulae.brew.sh/formula/dog) formula.
- For NixOS, install the [`dogdns`](https://search.nixos.org/packages?channel=unstable&show=dogdns&query=dogdns) package. -->


### Downloads

Binary downloads of doge are available from [the releases section on GitHub](https://github.com/Dj-Codeman/doge/releases/) for 64-bit Windows, macOS, and Linux targets. They contain the compiled executable, the manual page, and shell completions.


### Compilation

doge is written in [Rust](https://www.rust-lang.org).
I working on rustc version [1.76.0](https://blog.rust-lang.org/2024/02/08/Rust-1.76.0.html) you should be running this version or newer.
The recommended way to install Rust for development is from the [official download page](https://www.rust-lang.org/tools/install), using rustup.

To build, download the source code and run:

$ cargo build
$ cargo test


- If you are compiling a copy for yourself, be sure to run `cargo build --release` or `make build-release` to benefit from release-mode optimisations.
Copy the resulting binary, which will be in the `target/release` directory, into a folder in your `$PATH`.
`/usr/local/bin` is usually a good choice.

- To compile and install the manual pages, you will need [pandoc](https://pandoc.org/).
The `make man` command will compile the Markdown into manual pages, which it will place in the `target/man` directory.
To use them, copy them into a directory that `man` will read.
`/usr/local/share/man` is usually a good choice.


### Container image

To build the container image of doge, you can use Docker, Podman or Kaniko. Here an example using Docker:

$ docker build -t doge .

You can then run it using the following command:

$ docker run -it --rm doge

To run dog directly, you can then define the following alias:

$ alias doge="docker run -it --rm doge"


### Feature toggles

doge has three Cargo features that can be switched off to remove functionality.
While doing so makes doge less useful, it results in a smaller binary that takes less time to build.

There are three feature toggles available, all of which are active by default:

- `with_idna`, which enables [IDNA](https://en.wikipedia.org/wiki/Internationalized_domain_name) processing
- `with_tls`, which enables DNS-over-TLS
- `with_https`, which enables DNS-over-HTTPS (requires `with_tls`)

Use `cargo` to build a binary that uses feature toggles. For example, to disable TLS and HTTPS support but keep IDNA support enabled, you can run:

$ cargo build --no-default-features --features=with_idna

The list of features that have been disabled can be checked at runtime as part of the `--version` string.


---

## Documentation

For documentation on how to use doge, see the dog website: <https://dns.lookup.dog/>
Eventually I will make a new one
<h3>Docker/Podman</h3>
<p>To build the container image of doge, you can use Docker or Podman. Here an example using Docker:</p>
<code>$ docker build -t doge .</code>
<p>You can then run it using the following command:</p>
<code>$ docker run -it --rm doge</code>
<p>To run dog directly, you can then define the following alias:</p>
<code>$ alias doge="docker run -it --rm doge"</code>

<h3>Notes</h3>
<p>I am not a Rust expert at all, Honestly I'm the opposite, just learning coding. I used <a href="https://github.com/ogham/dog">dog</a> on my Arch system and a few random *nix Laptops that I perpetually fix and break. As such parts of maintaining and improving this project
will be outside of my understanding. Learning packaging, docker stuff and CI/CD. I'm too broke for a mac book, and currently refuse to
install windows 10/11, Small fixes and improvements I'll try to fix timely but major things especially on my non target machines might
take awhile - forever to fix ( please drop a PR ) in those cases :). </p>

<h4>Website</h4>
<p> I will make a website at some point... for the time being nothing to drastic has changed from the dog <a href=" https://dns.lookup.dog">website</a>
</p>
</div>
2 changes: 1 addition & 1 deletion completions/doge.bash
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ _doge()
;;
esac
} &&
complete -o bashdefault -F _dog dog
complete -o bashdefault -F _doge doge
2 changes: 1 addition & 1 deletion man/doge.1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% doge(1) v0.1.1
% doge(1) v0.2.7

<!-- This is the doge(1) man page, written in Markdown. -->
<!-- To generate the roff version, run `just man`, -->
Expand Down