mirror of
https://github.com/mageddo/dns-proxy-server.git
synced 2026-04-25 09:25:56 +03:00
[GH-ISSUE #8] Problem running on Ubuntu desktop #7
Labels
No labels
bug
confirmed
discussion
duplicate
enhancement
feature
feature-request
not-planned
pull-request
secondary-feature
stale
triage
waiting-feedback
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/dns-proxy-server-mageddo#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Sep 26, 2016).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/8
It runs just fine on Ubuntu Server but thats not a suitable development environment.
When running on a Ubuntu Desktop its unable to start on port 53.
developer@Dev:~/Code/DnsServer$ sudo node app.js { Error: bind EADDRINUSE 0.0.0.0:53 at Object.exports._errnoException (util.js:1036:11) at exports._exceptionWithHostPort (util.js:1059: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:592:11) at run (bootstrap_node.js:394:7) at startup (bootstrap_node.js:149:9) at bootstrap_node.js:509:3 code: 'EADDRINUSE', errno: 'EADDRINUSE', syscall: 'bind', address: '0.0.0.0', port: 53 }Listing processes on port 53 shows nothing:
lsof -i tcp:53How have you setup your development environment?
@mageddo commented on GitHub (Sep 26, 2016):
@fernfrost
Yes I did.
The solutions are two:
1 Find what program is starting a DNS server at your machine
You probably can not found with
lsof -i tcp:53because DNS servers uses UDP, Try the bellow to get the used portIn fact you can use this application running in another port (app.js:8
server.serve(53);) but by some tests that I've done linux could not understand a different port than 53.This is link talking about how disable the default Linux DNS server, network manager(used by Fedora and Unbutu desktop version) that start a local DNS server (53 port).
2 Run it from docker
more details
To use this approach you will need docker and JAVA installed, because using docker the application will use a port inside the docker container where everything is free to be used.
I suggest for test that you run:
It will change your DNS files automatically(only while the docker containers is running, after everything backs to original stage) or run
But it will not change your
/etc/resolv.conf( where you set your DNS servers) so you need to change manually. To change your/etc/resolv.confdo something like:To get the docker container ip you can run
docker inspect dns-proxy-serverTesting it
Finally to test if it is working run
nslookup dns.mageddoit need to be resolved by the dns-proxy-server@mageddo commented on GitHub (Sep 26, 2016):
In fact gradle is not necessary to use docker, for this reason I've created the #2 issue that implements a docker-compose.yml but not implemented yet
@ghost commented on GitHub (Sep 28, 2016):
Thank you.
running
netstat -anp | grep ":53"on a fresh install of ubuntu desktop reveals that networkmanager listens to port 53 (though it is listed as dnsmasq)I tried installing dnsmasq and setting the port=0.
This should according to documentation disable dns capabilities entirely.
But, alas, no success.
Running
killall dnsmasqsolved the problem but its not a good solutionI would like to utilize the dhcp capabilities of dnsmasq.
So is there a way of disable the built-in dns listening to port 53?
@ghost commented on GitHub (Sep 28, 2016):
Actually, setting port=0 in /etc/dnsmasq.conf, took effect after a reboot.
So happy for now:)
@ghost commented on GitHub (Sep 28, 2016):
Will
request.address.addressinhandleRequestbe the ip address of the device that made the request or will it always be 127.0.0.1?Is there a way of testing this other than
host some.domainon the local machine that always results in the request address being 127.0.0.1?@mageddo commented on GitHub (Sep 29, 2016):
I don't know how effective is the client IP identifier but testing with docker I did the follow:
host google.com 172.21.0.4in the anotherm=solve, requestFrom= 172.21.0.6really is the client IPTo make some tests you can do the same or create two virtual machines with Virtualbox, configure a bridge network, run the DNS in one and test from another.
I am curious, Why did it is important for you?