Skip to content

Dieken/dns4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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:

npm install --save dns4

And import it at the very beginning of your program:

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

// require() other modules

About

Node.js module to force IPv4 only lookup

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published