# dns4

> Force IPv4 only DNS lookup

Latest version **0.1.0** (published 2020-03-16) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install dns4
pnpm add dns4
yarn add dns4
bun add dns4
```

## 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.1.0 |
| Published | 2020-03-16 |
| First published | 2020-03-16 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Yubao Liu |
| Maintainers | dieken |
| Keywords | IPv4, IPv6, DNS |

## Links

- npm: https://www.npmjs.com/package/dns4
- Repository: https://github.com/Dieken/dns4
- Homepage: https://github.com/Dieken/dns4#readme
- Issues: https://github.com/Dieken/dns4/issues
- npm.io page: https://npm.io/package/dns4

## Recent versions

- 0.1.0 (latest) — 2020-03-16

## README

# dns4 - Node.js module to force IPv4 only lookup

Ubuntu 14.04(Trusty) uses glibc-2.19, which can't reliably resolve IP
address [under some circumstances](https://github.com/coredns/coredns/issues/2802).

Unluckily Node.js doesn't have an option like Java system property `java.net.preferIPv4Stack=true`,
it resolves both IPv4 and IPv6 addresses by default, so here is this tiny magical module.

WARNING: you'd better upgrade your host OS or Docker base image, usage of this hack is not recommended.

## Usage

Just include it in your package.json:

```bash
npm install --save dns4
```

And import it at the **very beginning** of your program:

```javascript
require('dns4')   // hijack functions of module dns

// require() other modules
```

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