{"id":13930177,"url":"https://github.com/r-bk/ch4","last_synced_at":"2025-07-19T12:31:54.064Z","repository":{"id":50557010,"uuid":"384320731","full_name":"r-bk/ch4","owner":"r-bk","description":"DNS Client Tool","archived":false,"fork":false,"pushed_at":"2025-05-16T12:18:47.000Z","size":450,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-17T01:51:03.354Z","etag":null,"topics":["dig","dns","resolver","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-bk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-09T04:28:46.000Z","updated_at":"2025-05-16T12:17:53.000Z","dependencies_parsed_at":"2024-12-15T06:23:14.270Z","dependency_job_id":"53892c06-ed27-4098-aabc-5a6141b149bb","html_url":"https://github.com/r-bk/ch4","commit_stats":{"total_commits":227,"total_committers":1,"mean_commits":227.0,"dds":0.0,"last_synced_commit":"470c3af935dbe7caf6f07ce23020a10ae2960c4a"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/r-bk/ch4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-bk%2Fch4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-bk%2Fch4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-bk%2Fch4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-bk%2Fch4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-bk","download_url":"https://codeload.github.com/r-bk/ch4/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-bk%2Fch4/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265588104,"owners_count":23793283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dig","dns","resolver","rust"],"created_at":"2024-08-07T18:05:03.866Z","updated_at":"2025-07-19T12:31:53.709Z","avatar_url":"https://github.com/r-bk.png","language":"Rust","funding_links":[],"categories":["rust"],"sub_categories":[],"readme":"# ch4 - DNS Client Tool\n\n**ch4** is a DNS Client CLI tool built around [rsdns](https://github.com/r-bk/rsdns).\n\n*ch4's* primary goal is to expose *rsdns's* capabilities in a concise manner.\nIt can be used as a simple substitute for [dig](https://en.wikipedia.org/wiki/Dig_(command)),\nwith which it tries to be mostly compatible.\n\n*ch4* by default uses the [tokio](https://github.com/tokio-rs/tokio) async runtime and the\ncorresponding *rsdns* client. It can be built with all clients and async runtimes supported\nby *rsdns* via the same set of features `net-tokio`, `net-async-std`, `net-smol` and `net-std`.\n\n[![crates.io][crates-badge]][crates-url]\n\n[crates-badge]: https://img.shields.io/crates/v/ch4.svg\n[crates-url]: https://crates.io/crates/ch4\n\n## Features\n\n1. Built on Linux, Windows, and MacOS\n2. Auto-detection of operating system's default nameserver\n\n\n## Supported RFCs\n- *rsdns* [supported RFCs](https://github.com/r-bk/rsdns#supported-rfcs)\n- [RFC 3597] - text representation of unknown record types\n\n[RFC 3597]: https://www.rfc-editor.org/rfc/rfc3597.html#section-5\n\n\n## Installation\n\n```shell\ncargo install ch4\n```\n\n*ch4* currently doesn't provide pre-built binaries.\nSee [rustrup.rs](https://rustup.rs) for installation of cargo and the Rust toolchain.\n\n\n## Examples\n\nNameserver address can be specified with the `@` prefix.\n\n```shell\n$\u003e ch4 @8.8.8.8 A docs.rs\n```\n```text\n; \u003c\u003c\u003e\u003e ch4 0.16.0 git:d7236e0 \u003c\u003c\u003e\u003e @8.8.8.8 A docs.rs\n;; -\u003e\u003eHEADER\u003c\u003c- opcode: QUERY, status: NOERROR, id: 31376\n;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1\n\n;; OPT PSEUDOSECTION:\n; EDNS: version: 0, flags:; udp: 512\n;; QUESTION SECTION:\n;docs.rs.                      IN     A      \n\n;; ANSWER SECTION:\ndocs.rs.                60     IN     A      13.226.2.120\ndocs.rs.                60     IN     A      13.226.2.68\ndocs.rs.                60     IN     A      13.226.2.78\ndocs.rs.                60     IN     A      13.226.2.103\n\n;; Query time: 62.709564ms\n;; SERVER: 8.8.8.8:53\n;; WHEN: Fri, 1 Nov 2024 08:56:36 +0200\n;; MSG SIZE rcvd: 100\n```\n\nWhen nameserver is not specified, it is auto-detected from the OS configuration.\n\n```shell\n$\u003e ch4 crates.io ANY\n```\n```text\n; \u003c\u003c\u003e\u003e ch4 0.16.0 git:d7236e0 \u003c\u003c\u003e\u003e crates.io ANY\n;; -\u003e\u003eHEADER\u003c\u003c- opcode: QUERY, status: NOERROR, id: 53667\n;; flags: qr rd ra; QUERY: 1, ANSWER: 12, AUTHORITY: 0, ADDITIONAL: 6\n\n;; OPT PSEUDOSECTION:\n; EDNS: version: 0, flags:; udp: 65494\n;; QUESTION SECTION:\n;crates.io.                      IN     ANY    \n\n;; ANSWER SECTION:\ncrates.io.                300    IN     TXT    \"v=spf1 include:mailgun.org ~all\"\ncrates.io.                300    IN     MX     10 mxa.mailgun.org.\ncrates.io.                300    IN     MX     10 mxb.mailgun.org.\ncrates.io.                900    IN     SOA    ns-1064.awsdns-05.org. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400\ncrates.io.                60     IN     A      13.226.2.64\ncrates.io.                60     IN     A      13.226.2.33\ncrates.io.                60     IN     A      13.226.2.63\ncrates.io.                60     IN     A      13.226.2.87\ncrates.io.                60     IN     NS     ns-817.awsdns-38.net.\ncrates.io.                60     IN     NS     ns-1064.awsdns-05.org.\ncrates.io.                60     IN     NS     ns-1543.awsdns-00.co.uk.\ncrates.io.                60     IN     NS     ns-217.awsdns-27.com.\n\n;; ADDITIONAL SECTION:\nns-217.awsdns-27.com.     22700  IN     A      205.251.192.217\nns-817.awsdns-38.net.     151496 IN     A      205.251.195.49\nns-1064.awsdns-05.org.    87690  IN     A      205.251.196.40\nns-1543.awsdns-00.co.uk.  35046  IN     A      205.251.198.7\nns-817.awsdns-38.net.     4691   IN     AAAA   2600:9000:5303:3100::1\n\n;; Query time: 16.550292ms\n;; SERVER: 127.0.0.53:53\n;; WHEN: Fri, 1 Nov 2024 08:55:57 +0200\n;; MSG SIZE rcvd: 487\n```\n\n\n## Options\n\n*ch4's* options follow the features exposed by *rsdns*.\nThe detailed list of options is shown via `--help` flag.\n\n```shell\n$\u003e ch4 --help\n```\n```text\nDNS Client\n\nUsage: ch4 [OPTIONS] [POSITIONAL]...\n\nArguments:\n  [POSITIONAL]...\n          Positional arguments ...\n          \n          Positional arguments may be specified without any particular order.\n          Arguments specified later take precedence.\n          Arguments that are not recognized as special are treated as names\n          to be queried.\n          \n          \n          @\u003cnameserver\u003e - specifies the nameserver IP address.\n                          If not specified, the first nameserver from OS\n                          configuration is used.\n          \n          \u003cqtype\u003e       - query type (A, AAAA, NS ...).\n                          An argument matching any of the supported query types\n                          is considered as query type. Trailing dot can be\n                          used to disambiguate a query name (A.).\n          \n          +udp          - sets the Udp protocol strategy. UDP is used by default.\n                          Truncated responses are retried using TCP.\n          \n          +tcp          - sets the Tcp protocol strategy.\n                          Only TCP is used for all queries.\n          \n          +notcp        - sets NoTcp protocol strategy. Only UDP is used.\n                          Truncated queries are returned as is, without retry.\n          \n          +[no]rec      - enables (disables) recursive query.\n                          Queries are recursive by default.\n          \n          +[no]short    - enables (disables) short output.\n                          When enabled, only record data is printed,\n                          one record on a line.\n          \n          +bufsize=#    - sets the EDNS0 max udp payload size [512, 65535].\n                          [default: 4096]\n          \n          +[no]edns[=#] - enables/disables EDNS0.\n                          Optionally, sets the EDNS version [0, 255].\n                          By default, EDNS is enabled with version 0.\n          \n          +[no]rust     - enables (disables) rust output.\n                          When enabled, prints the response as a Rust array.\n          \n          +[no]gen      - forces generic output (RFC 3597 s. 5) on all record\n                          types. By default, only unknown record types are\n                          formatted this way.\n\nOptions:\n  -p, --port \u003cPORT\u003e\n          [default: 53]\n\n  -l, --query-lifetime \u003cQUERY_LIFETIME\u003e\n          query lifetime (in msec).\n          \n          [default: 10000]\n\n  -t, --query-timeout \u003cQUERY_TIMEOUT\u003e\n          query timeout (in msec). Use 0 to disable.\n          \n          [default: 2000]\n\n      --info\n          Prints build information\n\n      --list-nameservers\n          Lists system nameservers\n\n  -s, --save \u003cSAVE_PATH\u003e\n          save responses to file\n\n  -r, --read \u003cREAD_PATH\u003e\n          read responses from file\n\n  -h, --help\n          Print help (see a summary with '-h')\n\n  -V, --version\n          Print version\n\n```\n\nThe list of operating system configured nameservers is shown via the `--list-nameservers` flag.\n\n```shell\n$\u003e ch4 --list-nameservers\n```\n```text\n8.8.8.8\n208.67.222.222\n8.26.56.26\n```\n\nBuild information is shown via `--info` flag.\n\n```shell\nC:\\\u003e ch4.exe --info\n```\n```text\nbuild time:          Fri, 1 Nov 2024 06:47:29 +0000\nch4 semver:          0.15.0\nrsdns semver:        0.19.0\ngit hash:            0a00162c47289da7b28d76904af13e0b90248a8f\ncompiler:            C:\\\\Users\\\\runneradmin\\\\.rustup\\\\toolchains\\\\stable-x86_64-pc-windows-msvc\\\\bin\\\\rustc.exe\nrustc:               rustc 1.82.0 (f6e511eec 2024-10-15)\ncargo features:      net_tokio, tokio\ncargo profile:       debug\ncargo target:        x86_64-pc-windows-msvc\nendianness:          little\npointer width:       64\nbuild system name:   Windows\nbuild os version:    Windows Server 2022 Datacenter\nbuild cpu vendor:    AuthenticAMD\nbuild cpu brand:     AMD EPYC 7763 64-Core Processor\n```\n\n## Changelog\n\nThe changelog is maintained in [CHANGELOG.md](CHANGELOG.md)\n\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0\n  ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n* MIT license\n  ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-bk%2Fch4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-bk%2Fch4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-bk%2Fch4/lists"}