# native-dns-packet

> Raw DNS Packet Parsing and Writing

Latest version **0.1.1** (published 2014-10-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install native-dns-packet
pnpm add native-dns-packet
yarn add native-dns-packet
bun add native-dns-packet
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2014-10-05 |
| First published | 2013-03-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.5.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 59 |
| Maintainers | tjfontaine, taoeffect |
| Keywords | dns, parsing |

## Links

- npm: https://www.npmjs.com/package/native-dns-packet
- Repository: http://github.com/tjfontaine/native-dns-packet
- Issues: http://github.com/tjfontaine/native-dns-packet/issues
- npm.io page: https://npm.io/package/native-dns-packet

## Dependencies (2)

- [ipaddr.js](https://npm.io/package/ipaddr.js.md) >= 0.1.1
- [buffercursor](https://npm.io/package/buffercursor.md) >= 0.0.12

## Recent versions

- 0.1.1 (latest) — 2014-10-05
- 0.1.0 (0.1.0) — 2014-10-05
- 0.0.4 — 2014-04-15
- 0.0.3 — 2013-05-25
- 0.0.2 — 2013-05-20
- 0.0.1 — 2013-03-24

## README

native-dns-packet
-----------------

 * `Packet.parse(buffer)` returns an instance of `Packet`
 * `Packet.write(buffer, packet)` writes the given packet into the buffer,
truncating where appropriate

```javascript
var Packet = function () {
  this.header = {
    id: 0,
    qr: 0,
    opcode: 0,
    aa: 0,
    tc: 0,
    rd: 1,
    ra: 0,
    res1: 0,
    res2: 0,
    res3: 0,
    rcode: 0
  };
  this.question = [];
  this.answer = [];
  this.authority = [];
  this.additional = [];
  this.edns_options = [];
  this.payload = undefined;
};
```

## History

###### 0.1.1 - October 5, 2014

- Fixing NPM tagging issue...

###### 0.1.0 - October 2, 2014

- Added TLSA support
- Fixed EDNS & NAPTR support + deprecates some EDNS fields on Packet
- Now includes support for forwarding EDNS responses (Packet.edns)
- Added many TODOs with suggested improvements
- Added many links to GH issues and RFCs
- Cleaned up code a bit to better please linters
- Added deprecation notices (see parseOpt)
- Handle unhandled RRs on writing packet instead of throwing exception.
- edns/opt should use BufferCursor.copy (Fixes #11)
- Updated `package.json` to include all authors
- Merged tj's `master` branch to add License info
- Updated README to include history of changes

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