You are not logged in.

#1 2015-11-16 19:34:56

netpumber
Member
Registered: 2009-09-20
Posts: 134

[Solved] Dnsmaq failed to create listening socket for port 53

Hello.

I just configured dnscrypt-proxy running on 2053 port and i wanna use it with dnsmaq for caching.
The problem is that after configuring /etc/dnsmaq.conf and trying to ran it it returns that error :

● dnsmasq.service - A lightweight DHCP and caching DNS server
   Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2015-11-16 21:12:13 EET; 5s ago
     Docs: man:dnsmasq(8)
  Process: 13478 ExecStart=/usr/bin/dnsmasq -k --enable-dbus --user=dnsmasq --pid-file (code=exited, status=2)
  Process: 13476 ExecStartPre=/usr/bin/dnsmasq --test (code=exited, status=0/SUCCESS)
Main PID: 13478 (code=exited, status=2)

Nov 16 21:12:13 nucleus.cell.org systemd[1]: Starting A lightweight DHCP and caching DNS server...
Nov 16 21:12:13 nucleus.cell.org dnsmasq[13476]: dnsmasq: syntax check OK.
Nov 16 21:12:13 nucleus.cell.org dnsmasq[13478]: dnsmasq: failed to create listening socket for port 53: Address already in use
Nov 16 21:12:13 nucleus.cell.org dnsmasq[13478]: failed to create listening socket for port 53: Address already in use
Nov 16 21:12:13 nucleus.cell.org systemd[1]: dnsmasq.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Nov 16 21:12:13 nucleus.cell.org systemd[1]: Failed to start A lightweight DHCP and caching DNS server.
Nov 16 21:12:13 nucleus.cell.org systemd[1]: dnsmasq.service: Unit entered failed state.
Nov 16 21:12:13 nucleus.cell.org systemd[1]: dnsmasq.service: Failed with result 'exit-code'.

Here is the configuration of dnscrypt :

/usr/lib/systemd/system/dnscrypt-proxy.service

[Unit]
Description=DNSCrypt client proxy
Requires=dnscrypt-proxy.socket

[Install]
Also=dnscrypt-proxy.socket
WantedBy=multi-user.target

[Service]
Type=simple
NonBlocking=true
ExecStart=/usr/bin/dnscrypt-proxy \
	  -R d0wn-de-ns2

/usr/lib/systemd/system/dnscrypt-proxy.socket

[Unit]
Description=dnscrypt-proxy listening socket

[Socket]
ListenStream=127.0.0.1:2053
ListenDatagram=127.0.0.1:2053

[Install]
WantedBy=sockets.target

DNScrypt seems to work because

 dig google.com @127.0.0.1 -p 2053

returns ip addresses.

Also i'm using systemd-networkd for networking and here is the /etc/systemd/network/wired.network file

[Match]
Name=enp3s0

[Network]
DNS=192.168.1.1
# Need this to forward network traffic from VMs.
IPForward=yes	

[Address]
Address=192.168.1.2/24

[Route]
Gateway=192.168.1.1

I will change the DNS variable into 127.0.0.1 when dnsmaq is ready.

Anyway... i was searching which program uses port 53 but couldn't find anything by running

lsof -i:53

Any idea ?

I forgot to post the /etc/dnsmaq.conf

bogus-priv
no-resolv
server=127.0.0.1#2053
user=nobody

listen-address=127.0.0.1

Last edited by netpumber (2015-11-16 19:41:45)

Offline

#2 2015-11-16 19:41:33

netpumber
Member
Registered: 2009-09-20
Posts: 134

Re: [Solved] Dnsmaq failed to create listening socket for port 53

Actually dnsmaq was running and that's why i took that error. I had to run to lsof command as root to see it.

Offline

Board footer

Powered by FluxBB