@krtn/dns-authoritative-server
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "@krtn/dns-authoritative-server", | ||
"description": "Pure JavaScript implementation of an authoritative name server", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"main": "./index.js", | ||
@@ -6,0 +6,0 @@ "types": "./index.d.ts", |
@@ -5,2 +5,3 @@ 'use strict' | ||
const dnsPacket = require('dns-packet') | ||
const rcodes = require('dns-packet/rcodes') | ||
@@ -29,7 +30,3 @@ class BaseServer { | ||
flags: dnsPacket.AUTHORITATIVE_ANSWER, | ||
opcode: 'QUERY', | ||
questions: dnsRequest.questions, | ||
answers: [], | ||
authorities: [], | ||
additionals: [] | ||
questions: dnsRequest.questions | ||
} | ||
@@ -42,7 +39,6 @@ | ||
response.rcode = 'NOERROR' | ||
response.answers = await this.#answerQuestions(dnsRequest.questions) | ||
} catch (e) { | ||
console.error('Error occurred when resolving answers', e) | ||
response.rcode = e instanceof ZoneNotAllowedError ? 'REFUSED' : 'SERVFAIL' | ||
response.flags |= rcodes.toRcode(e instanceof ZoneNotAllowedError ? 'REFUSED' : 'SERVFAIL') | ||
} | ||
@@ -75,6 +71,4 @@ | ||
type: 'A', | ||
class: 'IN', | ||
name: question.name, | ||
ttl: 30, | ||
flush: true, | ||
data | ||
@@ -81,0 +75,0 @@ }) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
53913
18
147
7