{"id":24857316,"url":"https://github.com/stacksjs/dnsx","last_synced_at":"2025-10-15T02:32:00.876Z","repository":{"id":272949015,"uuid":"918254994","full_name":"stacksjs/dnsx","owner":"stacksjs","description":"🌐 A command-line \u0026 library DNS client. Like dig \u0026 dog, but for TypeScript.","archived":false,"fork":false,"pushed_at":"2025-01-24T07:40:14.000Z","size":488,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-26T06:24:54.726Z","etag":null,"topics":["cli","dig","dns","dog","library","typescript"],"latest_commit_sha":null,"homepage":"https://dnsx.netlify.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stacksjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-17T15:02:55.000Z","updated_at":"2025-01-24T12:49:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"8549c7dd-b012-4b5b-ab45-c0a1592ce646","html_url":"https://github.com/stacksjs/dnsx","commit_stats":null,"previous_names":["stacksjs/dnsx"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fdnsx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fdnsx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fdnsx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fdnsx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stacksjs","download_url":"https://codeload.github.com/stacksjs/dnsx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236558795,"owners_count":19168518,"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":["cli","dig","dns","dog","library","typescript"],"created_at":"2025-01-31T17:52:54.012Z","updated_at":"2025-10-15T02:32:00.864Z","avatar_url":"https://github.com/stacksjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/stacksjs/dnsx/blob/main/.github/art/cover.jpg?raw=true\" alt=\"Social Card of this repo\"\u003e\u003c/p\u003e\n\n[![npm version][npm-version-src]][npm-version-href]\n[![GitHub Actions][github-actions-src]][github-actions-href]\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\u003c!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] --\u003e\n\u003c!-- [![Codecov][codecov-src]][codecov-href] --\u003e\n\n# dnsx\n\n\u003e A dependency-free \u0026 minimal DNS client. For the CLI, JavaScript \u0026 TypeScript.\n\n## Features\n\n- 🌐 Simple, lightweight DNS client\n- 🔎 Query any DNS record type _(A, AAAA, MX, TXT, etc.)_\n- 🔀 Multiple transport protocols _(UDP, TCP, TLS, HTTPS)_\n- 🎨 Colorized output with optional JSON format\n- 🤖 CLI and Library Support\n- 0️⃣ Zero runtime dependencies\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/stacksjs/dnsx/blob/main/.github/art/screenshot.png?raw=true\" alt=\"Screenshot of dnsx\"\u003e\u003c/p\u003e\n\n## Install\n\n```bash\nbun install -d @stacksjs/dnsx\n```\n\n## Get Started\n\nThere are two ways of using this DNS client: _as a library or as a CLI._\n\n### Library\n\nGiven the npm package is installed:\n\n```ts\nimport { DnsClient } from '@stacksjs/dnsx'\n\n// Simple query\nconst client = new DnsClient({\n  domains: ['example.com'],\n  type: 'A',\n  nameserver: '1.1.1.1'\n})\n\nconst responses = await client.query()\nconsole.log(responses)\n\n// Advanced configuration\nconst client = new DnsClient({\n  domains: ['example.com'],\n  type: ['A', 'MX', 'TXT'],\n  nameserver: '1.1.1.1',\n  udp: true, // use UDP transport\n  edns: 'show', // show EDNS records\n  txid: 1234, // set specific transaction ID\n  tweaks: ['aa', 'bufsize=4096'] // protocol tweaks\n})\n\nconst responses = await client.query()\n```\n\n### CLI\n\n```bash\n# Simple queries\ndnsx example.com                    # Query A record\ndnsx example.com MX                 # Query MX record\ndnsx example.com MX @1.1.1.1        # Use specific nameserver\ndnsx example.com MX @1.1.1.1 -T     # Use TCP transport\n\n# Advanced usage\ndnsx -q example.com -t MX -n 1.1.1.1 --edns show   # Show EDNS records\ndnsx example.com -J                                # JSON output\ndnsx example.com --short                           # Short output format\ndnsx example.com -Z bufsize=4096                   # Set UDP buffer size\n```\n\n## Configuration\n\nThe DNS client can be configured using CLI options or through the library interface:\n\n```ts\n// dnsx.config.ts\nimport type { DnsOptions } from '@stacksjs/dnsx'\n\nconst config: DnsOptions = {\n  // Query options\n  query: 'example.com', // Domain to query\n  type: 'A', // Record type (A, AAAA, MX, etc)\n  nameserver: '1.1.1.1', // Nameserver to query\n  class: 'IN', // Query class (IN, CH, HS)\n\n  // Protocol options\n  edns: 'show', // EDNS mode (disable, hide, show)\n  txid: 1234, // Transaction ID\n  Z: ['aa', 'bufsize=4096'], // Protocol tweaks\n\n  // Transport options\n  udp: true, // Use UDP transport\n  tcp: false, // Use TCP transport\n  tls: false, // Use DNS-over-TLS\n  https: false, // Use DNS-over-HTTPS\n\n  // Output options\n  short: false, // Short output format\n  json: false, // JSON output format\n  color: 'auto', // Color output (always, auto, never)\n  seconds: false, // Show raw seconds\n  time: false // Show query time\n}\n\nexport default config\n```\n\nAnd all CLI options map directly to these configuration options:\n\n```bash\nUsage:\n  $ dnsx [...args]\n\nCommands:\n  [...args]  Perform DNS lookup for specified domains\n  version    Show the version of dtsx\n\nFor more info, run any command with the `--help` flag:\n  $ dnsx --help\n  $ dnsx version --help\n\nOptions:\n  -q, --query \u003cHOST\u003e       Host name or domain name to query\n  -t, --type \u003cTYPE\u003e        Type of the DNS record being queried (A, MX, NS...)\n  -n, --nameserver \u003cADDR\u003e  Address of the nameserver to send packets to\n  --class \u003cCLASS\u003e          Network class of DNS record (IN, CH, HS)\n  --edns \u003cSETTING\u003e         Whether to OPT in to EDNS (disable, hide, show)\n  --txid \u003cNUMBER\u003e          Set transaction ID to specific value\n  -Z \u003cTWEAKS\u003e              Set uncommon protocol tweaks\n  -U, --udp                Use DNS over UDP (default: false)\n  -T, --tcp                Use DNS over TCP (default: false)\n  -S, --tls                Use DNS-over-TLS (default: false)\n  -H, --https              Use DNS-over-HTTPS (default: false)\n  -1, --short              Display nothing but first result (default: false)\n  -J, --json               Display output as JSON (default: false)\n  --color \u003cWHEN\u003e           When to colorize output (always, auto, never)\n  --seconds                Display durations in seconds (default: false)\n  --time                   Print response time (default: false)\n  --verbose                Print additional debugging information (default: false)\n  -h, --help               Display this message\n  -v, --version            Display version number\n\nExamples:\ndnsx example.com\ndnsx example.com MX\ndnsx example.com A AAAA NS MX\ndnsx example.com -t MX -n 1.1.1.1 -T\n```\n\n_Then run:_\n\n```bash\n./dnsx start\n```\n\nTo learn more, head over to the [documentation](https://reverse-proxy.sh/).\n\n## Testing\n\n```bash\nbun test\n```\n\n## Changelog\n\nPlease see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.\n\n## Contributing\n\nPlease review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.\n\n## Community\n\nFor help, discussion about best practices, or any other conversation that would benefit from being searchable:\n\n[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)\n\nFor casual chit-chat with others using this package:\n\n[Join the Stacks Discord Server](https://discord.gg/stacksjs)\n\n## Postcardware\n\n“Software that is free, but hopes for a postcard.” We love receiving postcards from around the world showing where `dnsx` is being used! We showcase them on our website too.\n\nOur address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎\n\n## Sponsors\n\nWe would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.\n\n- [JetBrains](https://www.jetbrains.com/)\n- [The Solana Foundation](https://solana.com/)\n\n## Credits\n\n- dig\n- [dog](https://github.com/ogham/dog)\n- [Chris Breuer](https://github.com/chrisbbreuer)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.\n\nMade with 💙\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/@stacksjs/dnsx?style=flat-square\n[npm-version-href]: https://npmjs.com/package/@stacksjs/dnsx\n[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/dnsx/ci.yml?style=flat-square\u0026branch=main\n[github-actions-href]: https://github.com/stacksjs/dnsx/actions?query=workflow%3Aci\n\n\u003c!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/dnsx/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/stacksjs/dnsx --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fdnsx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstacksjs%2Fdnsx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fdnsx/lists"}