# dns-js

> DNS Packet handling in pure javascript

Latest version **0.3.1** (published 2022-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install dns-js
pnpm add dns-js
yarn add dns-js
bun add dns-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2022-08-17 |
| First published | 2016-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 14.x |
| Dependencies | 2 |
| Unpacked size | 116.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Peter Magnusson |
| Maintainers | kmpm |

## Links

- npm: https://www.npmjs.com/package/dns-js
- Repository: https://github.com/mdns-js/node-dns-js
- Issues: https://github.com/mdns-js/node-dns-js/issues
- npm.io page: https://npm.io/package/dns-js

## Dependencies (2)

- [qap](https://npm.io/package/qap.md) ^3.1.2
- [debug](https://npm.io/package/debug.md) ^2.1.0

## Recent versions

- 0.3.1 (latest) — 2022-08-17
- 0.3.0 — 2022-08-12
- 0.2.1 — 2016-01-06

## README

dns-js
==============

[![Build Status](https://travis-ci.org/mdns-js/node-dns-js.svg?branch=master)](https://travis-ci.org/mdns-js/node-dns-js)

DNS packet parser specifically built for [mdns-js](https://github.com/mdns-js/node-mdns-js) 
but it should be generic enough to do general dns stuff.

NEW LOCATION

This project was moved into it's own organisation and changed name from node-mdns-js-packet to node-dns-js. 
Please update any git remotes you might have pointing here.

    git remote set-url origin https://github.com/mdns-js/node-dns-js.git



You probably want to have a look at 
[native-dns-packet](https://github.com/tjfontaine/native-dns-packet)
first and if that does do what you need, you might start looking at this.

dns-js should produce the same output as native-dns-packet,
it even uses it's test fixtures and borrows some parts of it.

This was made before i knew about native-dns-packet but since that
still has some bugs in handling some mDNS packets I cant use it.

example
-------

```javascript
var dns = require('dns-js');

/*some code that will get you a dns message buffer*/

var result = dns.DNSPacket.parse(message);

console.log(result);
```

Look at examples/dnsresolver.js for a more detailed example.

Contribute
----------
I will gladly accept any contributions as pull requests.
Just run __npm run lint__ on the code first so that the coding style
is kept somewhat consistent.
I miss doing this myself from time to time and I won't go ballistic if anyone
else forget but I would really appreciate it.

---
_Source: https://npm.io/package/dns-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
