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

unknow encoder undefined(41) #4

Closed
7c opened this issue Dec 20, 2017 · 3 comments
Closed

unknow encoder undefined(41) #4

7c opened this issue Dec 20, 2017 · 3 comments

Comments

@7c
Copy link

7c commented Dec 20, 2017

Hi,

i have developed a small demo based on your example like seen here:

const udp    = require('dgram');
const dns    = require('dns2');

const Packet = dns.Packet;

let rip=null;
let localPort=53;


var server = dns.createServer(function(request, send){
  var query = request.questions[0].name;
  console.log('> request %s', query);
    var response = new Packet(request);
    response.header.qr = 1;
    response.header.ra = 1;
	console.log('a');
    response.answers.push({
        name: query,
        type: Packet.TYPE.A,
        class: Packet.CLASS.IN,
        ttl: 300,
        address: rip
    });
 console.log('b');
   send(response);
});

require('dns').resolve4('ip8s.com',(err,addr)=>{
    if (err) {
        console.log(err.stack);
        process.exit(1);
    }
    rip=addr.shift();
    console.log('Will respond '+rip);
    server.listen(localPort,()=>{
        console.log("Server has been started at port *:"+localPort);
    });
});

I do run 9.2.1 on mac pro, everything seems to work fine. But i do get

node-dns > unknow encoder undefined(41) node-dns > unknow parser type: undefined(41)

on node 4/6/8. I have not tried node9 on that ubuntu 16 machine. Is that just a requirement issue or some other problem on my side please?

@lsongdev
Copy link
Owner

lsongdev commented Dec 20, 2017

@taskinosman Everything is ok when I run your code on my macOS .
unknow encoder/decoder 41 is EDNS, but EDNS not implement for current version (see #3 )

@7c
Copy link
Author

7c commented Dec 20, 2017

Thanks for answer, it works on my MacPRO. It does not work proplery on ubuntu 16, with node 4/6/8/9. I am getting this error. Actually i GET a reply to resolver BUT it also throws this error which confuses me. I dont think i am doing any extra efford for EDNS since i am using regular host command

@lsongdev
Copy link
Owner

same as #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants