Giter VIP home page Giter VIP logo

node-named's People

Contributors

aaronngray avatar brianin3d avatar cyberglot avatar demmer avatar netopwibby avatar nickylaczko avatar trevoro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-named's Issues

How to save DNS records?

I know this isn't an issue with the project itself and I'll close it asap but I was wondering how I might go about saving the DNS records I set.

It is important to remember that these DNS records are not permanently added to the server. They only exist for the length of the particular request. After that, they are destroyed. This means you have to create your own lookup mechanism.

I don't understand what the last part means because I thought DNS lookups were just that — looking up the DNS for a domain. I don't see how that would save DNS changes.

throw error

D:\Nodejs_Projects\person\dns.prj\node_modules\node-named>node examples\reflect.js
events.js:160
throw er; // Unhandled 'error' event
^

Error: bind EINVAL 127.0.0.1:9999
at Object.exports._errnoException (util.js:1026:11)
at exports._exceptionWithHostPort (util.js:1049:20)
at dgram.js:221:18
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3

D:\Nodejs_Projects\person\dns.prj\node_modules\node-named>node -v
v6.9.1

http://stackoverflow.com/questions/18733381/node-js-giving-error-bind-einval

Unable to get the Server API example in index.md to work

I have installed node-named on a fresh install of Ubuntu 12.04. To test it I am using the Server API example in node-named/docs/index.md

However whenever I try to use the dig command suggested in the docs:

$ dig @localhost -p9999 example.com SOA

It crashes with the following error:

{
"name":"named",
"hostname":"my-server-name",
"pid":1642,
"component":"agent",
"level":40,
"err":{"message":"undefined is not a function","name":"TypeError","stack":"TypeError: undefined is not a function\n at Server. (/apps/nodejs/dns/dns.js:12:15)\n at Server.EventEmitter.emit (events.js:95:17)\n at Socket. (/apps/nodejs/dns/node_modules/node-named/lib/server.js:92:30)\n at Socket.EventEmitter.emit (events.js:98:17)\n at UDP.onMessage (dgram.js:440:8)"},
"msg":"query handler threw an uncaughtException",
"time":"2014-04-22T17:12:08.972Z",
"v":0
}

Am I missing something?

EINVAL and EHOSTDOWN

Hi,
I've created a simple server, but if I make requests from the local machine (OS X El Capitan, dig command) always is ok, if I make requests from another computer in the same LAN (Windows 10, Chrome) always I get EHOSTDOWN or EINVAL errors.

The code I used is this.

var named = require('node-named')
var dns = require('dns')

var dnsServer = named.createServer()

dnsServer.on('query', (query) => {

  switch(query.type()) {

    case 'A':
      dns.resolve(query.name(), 'A', (err, addresses) => {

        if(err)
          return

        for(var i = 0; i < addresses.length; i++)
          query.addAnswer(query.name(), new named.ARecord(addresses[i]), 0)

        dnsServer.send(query)
      })

      break

  }
})

dnsServer.on('uncaughtException', (e) => console.log('LOG0'))
dnsServer.on('after', (e) => console.log('LOG1'))
dnsServer.on('clientError', (e) => console.log('LOG2'));

dnsServer.listen(process.env.DNS_PORT || 53, () => {
  console.log('DNS server started.')
})

Console output is this

imac-di-edoardo:ad Edoardo$ sudo npm start

> [email protected] start /Users/Edoardo/Desktop/FLRAuth/ad
> node server.js

DNS server started.
{ Error: send EHOSTDOWN ::ffff:192.168.1.4:61551
    at Object.exports._errnoException (util.js:1018:11)
    at exports._exceptionWithHostPort (util.js:1041:20)
    at SendWrap.afterSend [as oncomplete] (dgram.js:406:11)
  code: 'EHOSTDOWN',
  errno: 'EHOSTDOWN',
  syscall: 'send',
  address: '::ffff:192.168.1.4',
  port: 61551 }
{"name":"named","hostname":"imac-di-edoardo.local","pid":1081,"component":"agent","level":40,"adddress":"::ffff:192.168.1.4","port":61551,"err":{"message":"send EHOSTDOWN ::ffff:192.168.1.4:61551","name":"Error","stack":"Error: send EHOSTDOWN ::ffff:192.168.1.4:61551\n    at Object.exports._errnoException (util.js:1018:11)\n    at exports._exceptionWithHostPort (util.js:1041:20)\n    at SendWrap.afterSend [as oncomplete] (dgram.js:406:11)","code":"EHOSTDOWN","errno":"EHOSTDOWN","syscall":"send","address":"::ffff:192.168.1.4","port":61551},"msg":"send: unable to send response","time":"2017-04-18T16:45:12.387Z","v":0}

events.js:160
      throw er; // Unhandled 'error' event
      ^
ExceptionError: function () {
                return msg || name;
        }
    at SendWrap.callback (/Users/Edoardo/Desktop/FLRAuth/ad/node_modules/node-named/lib/server.js:137:44)
    at SendWrap.afterSend [as oncomplete] (dgram.js:411:8)

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.10.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ad package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ad
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ad
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Edoardo/Desktop/FLRAuth/ad/npm-debug.log

My node version is 6.10.1.

Thank you in advance.

NicTool integration & bundling

I'm wondering if node-named wouldn't be a nifty addition to NicTool? NicTool stores DNS data in a MySQL database and exports to a number of DNS servers. By using node-named, I'd opt to serve directly out of the database, which could obviously be a bottleneck. That could be worked around by caching MySQL query results in Redis for N seconds. Redis is fast enough to for all but the most demanding of DNS servers. Am I crazy?

Questions : What's append if no answer is added to query ?

Hello !

Thanks for your job, it's works very well for me.

It's more a general question about how DNS works. What's append if no answer is added to query ?

server.send(query) ( without query.addAnswer called).

Is the query will go to other server name ?

Thansk for your support

No License information

Hi :-)

would you please add a license like MIT ?

(Germans have big trouble with no license by law)

bind to default DNS port?

var named = require('node-named');

var server = named.createServer();

server.listen(53, '192.168.0.4', function() {
  console.log('DNS server started on port 53');
});

server.on('query', function(query) {
	console.log(query.name());
});
foo:dns brandonros$ sudo node app.js
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: bind EINVAL 192.168.0.4:53

new version to npm

Can you please publish a new version to npm since I'd like to be able to run with the fix from 73719b0.

Thanks!

named.test.js unittest failing

Run on Debian 8.5 with 'dig' available.

~/GitHub/node-named/test$ nodeunit named.test.js

named.test.js
Error: bind EINVAL 0.0.0.0:1153
    at Object.exports._errnoException (util.js:1050:11)
    at exports._exceptionWithHostPort (util.js:1073:20)
    at _handle.lookup (dgram.js:215:18)
    at _combinedTickCallback (internal/process/next_tick.js:83:11)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)

FAILURES: Undone tests (or their setups/teardowns): 
- listen and close (port only)

To fix this, make sure all tests call test.done()

Query object may be undefined due to Query.parse() throwing an error in lib/server.js

Hello trevoro,

Thanks for writing this library! =)

I've recently encountered an issue with the library as shown in the following error snippet:

There was a client error: ProtocolError: function () {
            return msg || name;
    }
/home/ubuntu/dnsd/node_modules/node-named/lib/server.js:87
            query.respond = function respond() {
                          ^
TypeError: Cannot set property 'respond' of undefined
    at Socket.<anonymous> (/home/ubuntu/dnsd/node_modules/node-named/lib/server.js:87:31)
    at Socket.EventEmitter.emit (events.js:98:17)
    at UDP.onMessage (dgram.js:437:8)

My assumption is that Query.parse() may have thrown an exception. It seems possible, via protocol.decode() when it encounters an invalid DNS record type.

I have implemented a possible fix on my fork; the query event will not be emitted if there is no query object returned.

Please see my pull request for details.

Module that may fit node-named users

Hello!

We developed a module that replaces/extends node's dns.lookup method. The main goal is to bypass issues with blocking of thread pool. So module caches responses.

I want to ask you is it possible to add link and short description to our module in your project?

Module was tested in production and highload environments. Also we have good unit and functional tests with 100% coverage, multi-records resolving and TTL support. Here it is: https://github.com/LCMApps/dns-lookup-cache

Thank you for reply!

Cannot bind to specific ipv4 address

Because node-named uses 'udp6' to create the socket, a specific IPv4 address to bind to gets ignored and the socket always listens on '::'

Consequently, when a DNS request arrives on a loopback IP address, the response is sent with an interface IP, and the client doesn't process it

Error binding to ipv4 interface: EINVAL

Hi,

I tried using this library on a debian machine binding to the default 0.0.0.0 adress.
My node version is 13.7.0.
The library fails to bind to the specified port (no matter which one I choose). I located the error in this line where it says udp6 instead of udp4. If I change it the error disappears and everything seems to work. But I don't understand why no one else seemed to have this issue before and why there even was udp6 in this line in the first place.

So it this a bug and can I change it?

Kind regards
Joshua

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.