mafintosh / dnsjack

A simple DNS proxy that lets you intercept domains and route them to whatever IP you decide.
173 stars 29 forks source link

Wrong dns response? #8

Open wwwzbwcom opened 5 years ago

wwwzbwcom commented 5 years ago

Using Linux dig: dig @127.0.0.1 example.com

In response say:

;; WARNING: recursion requested but not available
;; WARNING: Message has 50 extra bytes at end
aurelhann commented 5 years ago

found ! @wwwzbwcom see this issue :smiling_imp: https://github.com/wyhaya/updns/issues/8

aurelhann commented 5 years ago

and for the other warning fix it in parse.js

module.exports.response = (query, ttl, to) => {
    let response = {}
    let header = response.header = {}
    let question = response.question = {}
    let rrs = resolve(query.question.qname, ttl, to)

    header.id = query.header.id
    header.ancount = rrs.length

    header.qr = 1
    header.opcode = 0
    header.aa = 0
    header.tc = 0
    header.rd = 1
    header.ra = 1
    header.z = 0
    header.rcode = 0
    header.qdcount = 1
    header.nscount = 0
    header.arcount = 0

    question.qname = query.question.qname
    question.qtype = query.question.qtype
    question.qclass = query.question.qclass

    console.log('rr ' + JSON.stringify(rrs));
    response.rr = rrs

    return responseBuffer(response)
}

note that the header.ra has change

enjoy

dimitriaatos commented 4 years ago

I'm facing the same issue. @aurelhann I couldn't find any file named parse.js.

mensenvau commented 2 years ago

hrow er; // Unhandled 'error' event ^

Error: bind EACCES 0.0.0.0:53