Comments (6)
This happens when dns2 tries to answer to a request it did not understand (mostly OPT RR). The solution in my case was to filter out unsupported types from prepared responses.
// create a filter of supported data types
const SUPPORTED_TYPES = new Set(
Object.keys(dns.Packet.TYPE)
.map((key) => dns.Packet.TYPE[key])
.filter((val) => typeof val === "number")
);
const server = dns.createServer(function (request, send) {
// filter out unsupported requests (eg. EDNS)
if (request.additionals && request.additionals.length) {
request.additionals = request.additionals.filter((additional) =>
SUPPORTED_TYPES.has(additional.type)
);
}
....
from node-dns.
but the "unknown parser type: undefined(41) is still there.
That's because the encoder for that packet type doesn't exist in dns2.
Check my PR on gitlab for a more in-depth explanation.
TL;DR: This mostly (exclusively?) happens when the DNS client sends edns queries (DNS with some crypto auth request attached).
from node-dns.
I'm seeing the exact same issue. I'm a bit down the rabbit hole from minikube ingress-dns to cryptexlabs/minikube-ingress-dns:0.2.1
, to the sourcecode, to this package.
My issue arises when the systemd-resolverd stub-resolver performs a query. Using dig
to query the server directly is no problem. Here's the wireshark disector output:
from node-dns.
Simply clears out the additionals
field in the response:
response.additionals = [];
from node-dns.
Thank you.
response.additionals = []; removed the error message about unknown encoder, but the "unknown parser type: undefined(41) is still there.
from node-dns.
Hi:
Running the example server for IPv6 I recieve => Warning: Message parser reports malformed message packet.
dwuser@darwin:~$ dig @localhost -p 5333 google.com aaaa
;; Warning: Message parser reports malformed message packet.
; <<>> DiG 9.16.1-Ubuntu <<>> @localhost -p 5333 google.com aaaa
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1036
;; flags: qr rd ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; WARNING: Message has 10 extra bytes at end
;; QUESTION SECTION:
;google.com. IN AAAA
;; Query time: 8 msec
;; SERVER: 127.0.0.1#5333(127.0.0.1)
;; WHEN: Sun Mar 21 14:01:50 CST 2021
;; MSG SIZE rcvd: 60
This is the code I m using:
const dns2 = require('dns2');
const { Packet } = dns2;
const server = dns2.createUDPServer((request, send, rinfo) => {
const response = Packet.createResponseFromRequest(request);
const [ question ] = request.questions;
const { name } = question;
response.additionals = [];
response.answers.push({
name,
type: Packet.TYPE.AAAA,
class: Packet.CLASS.IN,
ttl: 300,
address: '2001:4860:4860::8888'
});
send(response);
});
server.on('request', (request, response, rinfo) => {
console.log(request.header.id, request.questions[0]);
});
server.listen(5333);
Thank you
from node-dns.
Related Issues (20)
- Response AAAA does not encode IPv6 Addresses with :: HOT 1
- Force IPv4 HOT 1
- How to send NX Domain HOT 1
- Requester's IP HOT 5
- The idea of rate limiting HOT 1
- Bad Typescript usage HOT 1
- Hi there, trying to get NS entries to work... HOT 1
- GeoDNS HOT 2
- UDP Server Type should be configurable (udp4 or udp6) HOT 3
- use for DNS01 challenges? HOT 2
- malformed ipv6 HOT 2
- Server stopping instantly? HOT 1
- How to send SRV records? HOT 4
- server sends response only when closing server HOT 1
- Max RPS
- Get SOA records
- Wrong response formatting for type AAAA HOT 4
- Intermittent long pauses when running as server
- Proxy protocol support
- EDNS Client Subnet (ECS) does not work with `resolve`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-dns.