Skip to content

Commit

Permalink
dns: cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Mar 14, 2018
1 parent 9fc8744 commit 2ecd49b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/dns/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class RootServer extends DNSServer {
const name = util.label(qs.name, labels, -1);

// Lookup the name data.
const data = await this.hsk.getDataByName(name, -1);
const data = await this.hsk.getDataByName(name.toLowerCase(), -1);

// Non-existent domain.
if (!data) {
Expand All @@ -105,25 +105,25 @@ class RootServer extends DNSServer {
// We should also be giving an NSEC proof
// here, but I don't think it's possible
// with the current construction.
if (ds) {
if (ds)
dnssec.signMessage(res, '.', key.pub, key.priv);
dnssec.signMessage(res, tld, key.pub, key.priv);
}

return res;
}

// Our resolution.
const rec = Resource.fromRaw(data);
const res = rec.toDNS(qs.name, qs.type, ds);
const resource = Resource.fromRaw(data);
const res = resource.toDNS(qs.name, qs.type, ds);

if (res.answer.length === 0
&& res.authority.length === 0) {
res.authority.push(this.toSOA());
}

if (ds)
if (ds) {
dnssec.signMessage(res, tld, key.pub, key.priv);
dnssec.signMessage(res, '.', key.pub, key.priv);
}

return res;
}
Expand Down

0 comments on commit 2ecd49b

Please sign in to comment.