Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ipv6 support for DNS servers #695

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions lib/dns/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const {
* Constants
*/

const RES_OPT = { inet6: false, tcp: true };
const RES_OPT = { tcp: true };
const CACHE_TTL = 30 * 60 * 1000;

/**
Expand Down Expand Up @@ -541,7 +541,11 @@ class RootServer extends DNSServer {
async open() {
await super.open(this.port, this.host);

this.logger.info('Root nameserver listening on port %d.', this.port);
this.logger.info(
'Root nameserver listening on %s (port=%d).',
this.host,
this.port
);
}

getReserved(tld) {
Expand Down Expand Up @@ -650,7 +654,6 @@ class RecursiveServer extends DNSServer {
this.stubPort = 5300;

this.hns = new UnboundResolver({
inet6: false,
tcp: true,
edns: true,
dnssec: true,
Expand Down Expand Up @@ -716,7 +719,6 @@ class RecursiveServer extends DNSServer {
assert(typeof options.noUnbound === 'boolean');
if (options.noUnbound) {
this.hns = new RecursiveResolver({
inet6: false,
tcp: true,
edns: true,
dnssec: true,
Expand Down Expand Up @@ -776,7 +778,11 @@ class RecursiveServer extends DNSServer {

await super.open(this.port, this.host);

this.logger.info('Recursive server listening on port %d.', this.port);
this.logger.info(
'Recursive server listening on %s (port=%d).',
this.host,
this.port
);
}

async close() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"blru": "~0.1.6",
"blst": "~0.1.5",
"bmutex": "~0.1.6",
"bns": "~0.15.0",
"bns": "pinheadmz/bns#ipv6",
"bsert": "~0.0.10",
"bsock": "~0.1.9",
"bsocks": "~0.2.6",
Expand Down