{"_id":"dns-lookup-cache","_rev":"6-675679415be4557fddfcc8f23649d73c","name":"dns-lookup-cache","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.2":{"name":"dns-lookup-cache","version":"1.0.2","description":"An implementation to speed up the nodejs `dns.lookup` method by avoiding thread pool and using resolve4/resolve6 with DNS TTL values","main":"index.js","engines":{"node":">=6.0"},"scripts":{"lint":"eslint ./","tests":"yarn run unit-test && yarn run func-test","unit-test":"NODE_ENV=test mocha --opts tests/mocha.opts -R spec ./tests/Unit/**","func-test":"NODE_ENV=test mocha --opts tests/mocha.opts --timeout 15000 -R spec ./tests/Functional/**","test:coverage":"NODE_ENV=test istanbul cover ./node_modules/.bin/_mocha --print both -- --opts tests/mocha.opts -R spec ./tests","coveralls":"NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --opts tests/mocha.opts -R spec ./tests/Unit && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"},"repository":{"type":"git","url":"git+https://github.com/LCMApps/dns-lookup-cache.git"},"keywords":["dns","lookup","resolve4","resolve6","cache","ipv4","ipv6"],"license":"MIT","dependencies":{"lodash":"^4.17.11","rr":"^0.1.0"},"devDependencies":{"chai":"^4.1.2","coveralls":"^3.0.2","eslint":"4.19.1","istanbul":"^0.4.5","mocha":"^5.2.0","proxyquire":"^2.1.0","sinon":"^6.3.3"},"bugs":{"url":"https://github.com/LCMApps/dns-lookup-cache/issues"},"homepage":"https://github.com/LCMApps/dns-lookup-cache","gitHead":"97a6f05c6de56e2e0f8e1f5a9db359de81edd3dd","_id":"dns-lookup-cache@1.0.2","_npmVersion":"5.0.3","_nodeVersion":"8.1.3","_npmUser":{"name":"woz","email":"d.menshikov@gmail.com"},"dist":{"integrity":"sha512-Z9X/0u/4fIqOf+PEKpd/GTQ2uuhLDcy2lkXOkofd7f+Tr1UQqjVDP3SbmkQpKRXIq6Eb+l6jZ2vTtcBPr4Ipdw==","shasum":"81f36b0d7ea032e966fbded33b5b3acc376dd551","tarball":"https://registry.npmjs.org/dns-lookup-cache/-/dns-lookup-cache-1.0.2.tgz","fileCount":33,"unpackedSize":135222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbn9lhCRA9TVsSAnZWagAAzxEP/jizBqgq/Vjm46SI1QpO\n5TKABFMpqmZ5TNyCg9GU+hEbNiNKAeE7JljoAS/Xbr4jHLnIV+OHszcMNktY\nqJS9NE5eXotj5Cass4nqCj4torPApgm7UWrzY6PnBwMcVbMN7f3qYgqlQLK/\nQ1aNpZgN+ZzbrSzxIXy6/rUGT4N8vaZJt9cNIQXBzL3ZpGaS9eQqkDpSqOJq\nm0WcPGtUou+GKLytgjs6RVREwHlOwBdN8QusxMbMGQN2RZFx+FjChKUts/AE\nNLkN+hiYE0536ZWJSizxmCD3rZJ2U/W97ijJxr6bwuemEkF4bRLYlJL+3r8a\n2ZuGxhnwTuhfc9IiWBE2l7oE8LxOo3oW3eV1iCgGpgwR2nnbhEFuorxH3017\nl2XgAXuIUnIWkmpMVV6b60bGBt5lD+tCZaEwhAyfTSHhOIvluJRtQW9JVSF4\nwmVq3ofc0WsxGFJjpsHqnip0OAyQ2vgXpuSlf5jNyfjisUPg9+VCCw3fcfPD\nG2DM49xKlChtxCajlqKGBw3evdVRQpPFmXAfoXkmv35UeadJWESeCqejEfq5\nrUo4CSg++Xre7Sawt7InbnA/t80CqtB0KhWnvDnTHWIAyS5xIBw3zGhSLXmy\nqquGMIuXRl+VP83OwWY8kJ0DLKwhiY/E8jxU67KkP/IMR6ALH0QKrqxCUY1a\n4Tzz\r\n=kdEc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/zcwQW1/NT22TzcTM8N5UnVZMxEuG9C2x+vAAa872qAIgTYv1Tr+l8jtXEVLyJadct7WBcbdaoo1qHPksoDRsoNI="}]},"maintainers":[{"name":"woz","email":"d.menshikov@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dns-lookup-cache_1.0.2_1537202529249_0.5593806083317416"},"_hasShrinkwrap":false},"1.0.3":{"name":"dns-lookup-cache","version":"1.0.3","description":"An implementation to speed up the nodejs `dns.lookup` method by avoiding thread pool and using resolve4/resolve6 with DNS TTL values","main":"index.js","engines":{"node":">=6.0"},"scripts":{"lint":"eslint ./","tests":"yarn run unit-test && yarn run func-test","unit-test":"NODE_ENV=test mocha --opts tests/mocha.opts -R spec ./tests/Unit/**","func-test":"NODE_ENV=test mocha --opts tests/mocha.opts --timeout 15000 -R spec ./tests/Functional/**","test:coverage":"NODE_ENV=test istanbul cover ./node_modules/.bin/_mocha --print both -- --opts tests/mocha.opts -R spec ./tests","coveralls":"NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --opts tests/mocha.opts -R spec ./tests && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"},"repository":{"type":"git","url":"git+https://github.com/LCMApps/dns-lookup-cache.git"},"keywords":["dns","lookup","resolve4","resolve6","cache","ipv4","ipv6"],"license":"MIT","dependencies":{"lodash":"^4.17.11","rr":"^0.1.0"},"devDependencies":{"chai":"^4.1.2","coveralls":"^3.0.2","eslint":"5.8.0","istanbul":"^0.4.5","mocha":"^5.2.0","proxyquire":"^2.1.0","sinon":"^7.1.0"},"bugs":{"url":"https://github.com/LCMApps/dns-lookup-cache/issues"},"homepage":"https://github.com/LCMApps/dns-lookup-cache","gitHead":"d188bf11cbd8a4b188110688747e2b9341df352d","_id":"dns-lookup-cache@1.0.3","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"woz","email":"d.menshikov@gmail.com"},"dist":{"integrity":"sha512-Fai5211iwY1csbliQsTnbonqHP4v9Y8WDBlR8FtBeNJSMweLY4PlKOhImrsaW+Zy3rmnqSXevE8ZWbOjjl4L+w==","shasum":"4459fb5d7a05ec261455bfb244f2ebfdf7179e40","tarball":"https://registry.npmjs.org/dns-lookup-cache/-/dns-lookup-cache-1.0.3.tgz","fileCount":33,"unpackedSize":136898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2EIzCRA9TVsSAnZWagAANPkQAKALn81kyn8CHva0LMPJ\nusoo594dgCtLBjWobrVwv1clBxAW/aeD0u/WNV2McIp8olO8Q6expH+i2zM9\nkmz9sI84QqxY7lS+cBe1mL8X6mZvZ+8SEiM+X53Y3VT6yl4nLhpTulIu5sP4\nwJZBFbuAzKtc5up0zZjEAwXzvLCzvylVPkfqXdOqIdmFeIaEJvPNxOYbfiun\nv3AjNo5NzLNa34bZsn7jdIcn7uB5Okgv/0JBav7qKlFcrDGj7cuc3Mp+X16O\nuNJlWm7SmuGISTafdOfQuu9XGux9QsIsEw8bzm3cykA4USTJ8E/bDS1mXLip\ngc81DeYhG7cywnWn9phCja7a4Q4U0Ht0y31kUnELpXYdq/jj80Q+9PDolqWw\npQ6fi1mPE5qFCoIIaZbML2mAMNP07/ubfZdPpfFOk0TyO55gww0AbvDH82NR\nVGCRORzHWdDAcrWPeAg9dO0QAxJNsCslFfI4hW8ntXqxs69FyFCdh6ldCLY4\nBS6iq2WtOM8lUqpHE5wJK8+L5LLbwBNkhjjoMMiDHuM8E3hvnGkyREmMY4Kq\nNe3N7mZW2dkzyormxHshGz9kmvBlOM1DZm6XkbEVgQFaR6U13vUbT95FRbkA\nJ+uQ/Ut/0mKYCWriGw6hj7fCFoNMH9vfZc+KpEFRIYGE/dFnBeytHB1EtoI2\nYm9W\r\n=9OfR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsKg6lk9SXCftKgfoyyNGaVVKlIqd5tZmokhmOlXJzTAIhAK5lFxnSvxeHpgZtvf3iaGSJcp1QjOyDjsOYHX0iXxkt"}]},"maintainers":[{"name":"woz","email":"d.menshikov@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dns-lookup-cache_1.0.3_1540899379088_0.46842115871399503"},"_hasShrinkwrap":false},"1.0.4":{"name":"dns-lookup-cache","version":"1.0.4","description":"An implementation to speed up the nodejs `dns.lookup` method by avoiding thread pool and using resolve4/resolve6 with DNS TTL values","main":"index.js","engines":{"node":">=6.0"},"scripts":{"lint":"eslint ./","tests":"yarn run unit-test && yarn run func-test","unit-test":"NODE_ENV=test mocha --opts tests/mocha.opts -R spec ./tests/Unit/**","func-test":"NODE_ENV=test mocha --opts tests/mocha.opts --timeout 15000 -R spec ./tests/Functional/**","test:coverage":"NODE_ENV=test istanbul cover ./node_modules/.bin/_mocha --print both -- --opts tests/mocha.opts -R spec ./tests","coveralls":"NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --opts tests/mocha.opts -R spec ./tests && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"},"repository":{"type":"git","url":"https://github.com/LCMApps/dns-lookup-cache.git"},"keywords":["dns","lookup","resolve4","resolve6","cache","ipv4","ipv6"],"license":"MIT","dependencies":{"lodash":"^4.17.11","rr":"^0.1.0"},"devDependencies":{"chai":"^4.1.2","coveralls":"^3.0.2","eslint":"5.14.1","istanbul":"^0.4.5","mocha":"^6.0.2","proxyquire":"^2.1.0","sinon":"^7.1.0"},"bugs":{"url":"https://github.com/LCMApps/dns-lookup-cache/issues"},"homepage":"https://github.com/LCMApps/dns-lookup-cache","licenseText":"MIT License\n\nCopyright (c) 2018 Eduard Bondarenko <eduardbcom@gmail.com>\nCopyright (c) 2018 Oleh Poberezhets <legenage@gmail.com>\nCopyright (c) 2018 Alexandr Lisovenko <fox.cpp@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"dns-lookup-cache@1.0.4","dist":{"shasum":"fab28a97ef320215d9255ce866b7dc769acf1762","integrity":"sha512-528ydOnvZQ+a0f+BfmBU4A5zGb05uvwxN/u96/yQdSA7Z8uwDXHXJ+FEPl5UI91Ga7SNyDT4csL9x4pWMHMCyg==","tarball":"https://registry.npmjs.org/dns-lookup-cache/-/dns-lookup-cache-1.0.4.tgz","fileCount":45,"unpackedSize":93131,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKZ1XCRA9TVsSAnZWagAALZwP/Rc5XQ9OXgk/Qa00HLvb\njBrhkUDrNXTh56B7YLACW1smxfewT/ghgwKoLFC75DTnzZgrSwBhXsdIiGVf\nabqViYIS84W9UfqVyq0suL3fdG/MWzw/qOn7WLIrT56k3/x33e1A0qZOqSIe\nb5A7zEZ6ROn3XEVJ2jWEukhZeaCF/VJ/IP7a25YhULX5xtSl1QtD0DeDAX/2\nM/6swCIjMoaWUzzLH3Vk8AI79aO6uDeGlGNy5dMbGwhTtx1a4vLNXXMuF1Ur\nFJOtmNB8k9tD8Wf4AyepXkLxKbhPhj9kwm07R4m2HzoBPmKTdyHGocr0Mhyy\nMmyNAjsX3vsj3cm060t9iJ48V1kNoMGAJV4C8JFruLlop9Sr9PHqI6Uk8/Of\nR4vuaMFOHQhSKM/Z4siq72kzhSPC1VmSatr/bwecy/WTwbJdM843GtqStLM4\nHSskfgRwT2Ow1/9hRSrMNlhDmicSirfKGtGOWVklpjgzCjt0lUB5dCTiOyUd\n1aGzSmeMdoGCXiy7rebksZBBcGnsq7l03+lKkthlgHe3opGOPB+mibCabOhL\nmtI3ZEYjDYGYQaSWjCxIU+6ibx++IUdE2DEtRDIqyjRkHXQ/5ITrEJtP+38Y\naYolyVaZScWt/fdDtln+YAnJbgFoAUmNlw1jpdhnDmJk3w2ydN0JgFKkG52j\npz/d\r\n=yGdr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCt5d2jrwgB883DIBTwY2W35c9GHzLqoF2zufbMgELDnQIhAOJnfJu+/t3wMmiqd87TlYnyNh1+VaLCBcqCY5J4dABm"}]},"maintainers":[{"email":"fox.cpp@gmail.com","name":"fox_hellraiser"},{"email":"fxmaxvl@gmail.com","name":"fxmaxvl"},{"email":"elijah.zakirov@gmail.com","name":"jangolle"},{"email":"techleads@auroraglobal.com","name":"lcmbot"},{"email":"legenage@gmail.com","name":"legenage"},{"email":"d.menshikov@gmail.com","name":"woz"}],"_npmUser":{"name":"lcmbot","email":"techleads@auroraglobal.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dns-lookup-cache_1.0.4_1579785557911_0.5508661411829161"},"_hasShrinkwrap":false}},"time":{"created":"2018-09-17T16:42:09.248Z","1.0.2":"2018-09-17T16:42:09.402Z","modified":"2022-04-29T00:21:09.421Z","1.0.3":"2018-10-30T11:36:19.227Z","1.0.4":"2020-01-23T13:19:18.735Z"},"maintainers":[{"email":"fox.cpp@gmail.com","name":"fox_hellraiser"},{"email":"fxmaxvl@gmail.com","name":"fxmaxvl"},{"email":"elijah.zakirov@gmail.com","name":"jangolle"},{"email":"techleads@auroraglobal.com","name":"lcmbot"},{"email":"legenage@gmail.com","name":"legenage"},{"email":"d.menshikov@gmail.com","name":"woz"}],"description":"An implementation to speed up the nodejs `dns.lookup` method by avoiding thread pool and using resolve4/resolve6 with DNS TTL values","homepage":"https://github.com/LCMApps/dns-lookup-cache","keywords":["dns","lookup","resolve4","resolve6","cache","ipv4","ipv6"],"repository":{"type":"git","url":"https://github.com/LCMApps/dns-lookup-cache.git"},"bugs":{"url":"https://github.com/LCMApps/dns-lookup-cache/issues"},"license":"MIT","readme":"# dns-lookup-cache - DNS cache to replace NodeJS `dns.lookup` standard method\n\n[![NPM version](https://img.shields.io/npm/v/dns-lookup-cache.svg)](https://www.npmjs.com/package/dns-lookup-cache)\n[![Release Status](https://github.com/LCMApps/lcm-requester/workflows/NPM%20Release/badge.svg)](https://github.com/LCMApps/dns-lookup-cache/releases)\n[![Build Status](https://travis-ci.org/LCMApps/dns-lookup-cache.svg?branch=master)](https://travis-ci.org/LCMApps/dns-lookup-cache)\n[![Coverage Status](https://coveralls.io/repos/github/LCMApps/dns-lookup-cache/badge.svg?branch=master)](https://coveralls.io/github/LCMApps/dns-lookup-cache?branch=master)\n\n## Super simple to use\n\n```js\nconst request = require('request');\nconst {lookup} = require('dns-lookup-cache');\n\n// With \"request\" module\n\nrequest({\n    url: 'http://google.com',\n    method: 'GET',\n    lookup: lookup\n}, (error, response, body) => {\n    // ...\n});\n\n// Direct usage\n\nlookup('google.com', {}, (error, address, family) => {\n    // ...\n});\n```\n\n## Table of contents\n\n- [Motivation](#motivation)\n- [How to use](#howtouse)\n- [Inner implementation](#implementation)\n- [Examples](#examples)\n\n---\n\n## Motivation\n\nThe main idea behind this package is eliminate NodeJS event loop usage when you do network request.\nSee [NodeJS DNS implementation](https://nodejs.org/api/dns.html#dns_implementation_considerations) to understand the problem with `dns.lookup`.\n\n\n[back to top](#table-of-contents)\n\n---\n\n## How to use\n\nThis module supports almost the same params as `dns.lookup` does. Concretely, you can pass `options` object as a second param, and\nset:\n- `family` to `4` or `6`\n- `all` flag to `true`/`false` if you want/don't want get all IP addresses at once.\n\nBecause this implementation does not use `getaddrinfo` method, the `hints` param is not supported.\n\nThe `verbatim` param is not supported for now. If you will not specify any family you will get IPv4 addresses first and IPv6 addresses second.\n \nThe `callback` function works the same way as a standard method.\n\nThe `error` object would have all fields the standard implementation's error object has.\n\nNodeJS `dns.lookup`:\n```javascript\n> const dns = require('dns');\n> dns.lookup('host-doesnot-support-ipv6', {family: 6}, console.log)\n\n> { Error: getaddrinfo ENOTFOUND host-doesnot-support-ipv6\n    at errnoException (dns.js:55:10)\n    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:26)\n  code: 'ENOTFOUND',\n  errno: 'ENOTFOUND',\n  syscall: 'getaddrinfo',\n  hostname: 'host-doesnot-support-ipv6' }\n\n```\n\n`dns-lookup-cache`\n```javascript\n> const {lookup} = require('dns-lookup-cache');\n> lookup('host-doesnot-support-ipv6', {family: 6}, console.log)\n\n> { Error: queryAaaa ENOTFOUND host-doesnot-support-ipv6\n      at makeNotFoundError (/path/dns-lookup-cache/src/Lookup.js:182:19)\n      at ipv6AddressesTable.resolve (/path/dns-lookup-cache/src/Lookup.js:147:37)\n      at Immediate.setImmediate [as _onImmediate] (/path/dns-lookup-cache/src/IpAddressesTable.js:70:48)\n      at runCallback (timers.js:773:18)\n      at tryOnImmediate (timers.js:734:5)\n      at processImmediate [as _immediateCallback] (timers.js:711:5)\n    hostname: 'host-doesnot-support-ipv6',\n    syscall: 'queryAaaa',\n    code: 'ENOTFOUND',\n    errno: 'ENOTFOUND' }\n```\n\nIf you are looking for `IPv4` addresses only, explicitly specify param `{family: 4}`. In that case, you will avoid \nspending time on useless searching for `IPv6`. Apply the same technique if you are looking for `IPv6` addresses only. \n\nUnder the hood, `lookup` method has Round-robin algorithm. It means that if particular hostname resolves to several addresses\nit will return new address every time you call that function. For example:\n```javascript\n// hostname: example.com\n// resolves to: [1.2.3.4, 5.6.7.8, 9.10.11.12]\n\nlookup('example.com', {family: 4}, (error, address, family) => {\n   // address === \"1.2.3.4\"\n   // family === 4\n});\n\nlookup('example.com', {family: 4}, (error, address, family) => {\n   // address === \"5.6.7.8\"\n   // family === 4\n});\n\nlookup('example.com', {family: 4}, (error, address, family) => {\n   // address === \"9.10.11.12\"\n   // family === 4\n});\n\nlookup('example.com', {family: 4}, (error, address, family) => {\n   // address === \"1.2.3.4\"\n   // family === 4\n});\n```\n\n[back to top](#table-of-contents)\n\n---\n## Implementation\n\nUnder the hood, this package uses `dns.resolve4` and `dns.resolve6` methods with `{ttl: true}` param.\nIt caches addresses for that particular hostname for DNS TTL time and returns one address if you specified `{all: false}` (default value)\nand array of addresses if `{all: true}`.\n\nIf you didn't specify family type (`{family: 4}` or `{family: 6}`) the method searches for addresses of `{family: 4}` and `{family: 6}` in parallel.\nAfter that, if you specified `{all: true}` it returns an array in form `[[...IPv4],[...IPv6]]`, in other case it returns `IPv4` or `IPv6` address.\n(`IPv4` has more priority).\n\n[back to top](#table-of-contents)\n\n---\n## Examples\n\n```javascript\nlookup('hostname', {all: true}, (error, results) => {\n   // results is an array that contains both IPv4 and IPv6 addresses (Ipv4 first).\n   //\n   // error - null\n   // results - [ \n   //   { address: '1.2.3.4', family: 4 },\n   //   { address: '5.6.7.8', family: 4 } \n   // ]\n});\n```\n\n```javascript\nlookup('hostname', {all: false}, (error, address, family) => {\n   // address and family of the first resolved IP (IPv4 or IPv6 if supported).\n   // error - null\n   // address - '1.2.3.4'\n   // family - 4\n});\n```\n\n```javascript\nlookup('hostname', {all: false, family: 4}, (error, address, family) => {\n   // address and family of the first resolved IP (IPv4 only). \n});\n```\n\n```javascript\nlookup('hostname', {all: false, family: 6}, (error, address, family) => {\n   // address and family of the first resolved IP (IPv6 only).\n   // will return an error if IPv6 is not supported. See NodeJS dns.lookup doc.\n});\n```\n\n[back to top](#table-of-contents)\n\n---\n## Similar packages\n\nYahoo tried to solve this problem in own way https://github.com/yahoo/dnscache.\n\nThe big disadvantages if this package are:\n- monkey patching dns module\n- does not support DNS TTL\n- cache just one IP address and use it for every request (no advantage of round-robin if you have dns resolver that returns several addresses)\n\n[back to top](#table-of-contents)\n","readmeFilename":"README.md"}