Web lists-archives.com

Re: cannot get node dns program to work externally




I haven't run this locally to test, but you appear to be binding only to the localhost address: https://github.com/tjfontaine/node-dns/blob/master/examples/forwarder.js#L10

This should exhibit the symptoms you mention and allow it to work on localhost and not on remote addresses. Change this from '127.0.0.1' to '0.0.0.0' to bind on all addresses and it should be available externally as well.

Mikkel

On Monday, August 7, 2017 at 2:56:11 PM UTC-7, AaronNGray wrote:
Hi,

I have a node.js based dns program on port 53 and have it working as localhost on debian 8.5 but I cannot seem to get it to work externally despite getting the firewall rules right having tested them with Bind9.

-A INPUT -p udp --dport 53 --sport 1024:65535 -j ACCEPT
-A OUTPUT -p udp --sport 53 --dport 1024:65535 -j ACCEPT
-A OUTPUT -p udp --sport 53 --dport 1024:65535 -j ACCEPT
-A INPUT -p udp --dport 53 --sport 1024:65535 -j ACCEPT

-A OUTPUT -p udp --sport 53 --dport 53 -j ACCEPT
-A INPUT -p udp --dport 53 --sport 53 -j ACCEPT

Also I have done :-

    setcap cap_net_bind_service=+ep /usr/bin/nodejs

to allow node to work with ports less than 1024.

I have my node dns program working on port 53 UDP with dig from localhost but Basically not externally on the local network and cannot work out why ?

I have mainly been using :-


for testing.

Its probably something obvious hope someone can help !

--
Aaron Gray

Independent Open Source Software Engineer, Computer Language Researcher, Information Theorist, and amateur computer scientist.