Logging not working (Ubuntu 18 and Debian 9)
I have read through the previous issues and resolutions with no avail. I've fresh installed on both my Debian and Ubuntu instances and neither of them are pushing out logs. I've tried the stock config and enabling one option at a time just as suggested none of which is pushing any logging information to syslog or any log file.
Is there a way to troubleshoot as to what is causing this?
How did you install it?
I tried with the built in installer on both systems.
Can you post a minimally changed config file somewhere?
https://pastebin.com/VnPwAPbN
I just setup another instance on an Ubuntu 18 box and I only changed:
server_names = ['dns00']
listen_addresses = ['127.0.0.1:5353']
log_file = 'dnscrypt-proxy.log'
<commented out public servers>
<added dns00>
~~Same result. no logs.~~ Rebooted instance after installing the service and logs showed up in the /opt/dnscrypt-proxy folder
listen_addresses = []
How can that work? You need an actual address here.
fallback_resolver = '0.0.0.0:53'
How can that work? You can't connect to 0.0.0.0, at best it will loop.
So, if you send a query to a nonexistent name, is the /var/log/dnscrypt-proxy/dnsnx.log file at least created?
The pastebin config is for a systemd configuration.
Here is my systemd service:
[Unit]
Description=DNSCrypt-proxy client
Documentation=https://github.com/jedisct1/dnscrypt-proxy/wiki
Requires=dnscrypt-proxy.socket
After=network.target
Before=nss-lookup.target
Wants=nss-lookup.target
[Service]
NonBlocking=true
ExecStart=/opt/dnscrypt-proxy/dnscrypt-proxy --config /opt/dnscrypt-proxy/dnscrypt-proxy.toml
ProtectHome=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
DynamicUser=yes
CacheDirectory=dnscrypt-proxy
LogsDirectory=dnscrypt-proxy
RuntimeDirectory=dnscrypt-proxy
[Install]
Also=dnscrypt-proxy.socket
WantedBy=multi-user.target
The socket file:
[Unit]
Description=DNSCrypt-proxy socket
Documentation=https://github.com/jedisct1/dnscrypt-proxy/wiki
Before=nss-lookup.target
Wants=nss-lookup.target
[Socket]
ListenStream=127.0.0.1:5353
ListenDatagram=127.0.0.1:5353
NoDelay=true
DeferAcceptSec=1
[Install]
WantedBy=sockets.target
Where does all this systemd junk come from? The -service install command would never install anything like that.
listen_addresses = []How can that work? You need an actual address here.
as per systemd socket configuration
fallback_resolver = '0.0.0.0:53'How can that work? You can't connect to
0.0.0.0, at best it will loop.So, if you send a query to a nonexistent name, is the
/var/log/dnscrypt-proxy/dnsnx.logfile at least created?
I do not want a fallback resolver. I do not get any logs showing up in /var/log/dnscrypt-proxy.
Where does all this systemd junk come from? The
-service installcommand would never install anything like that.
Came from your wiki: https://github.com/jedisct1/dnscrypt-proxy/wiki/systemd
Remove everything and just use -service install.
Got it to work on the Debian box!
For some reason or another there were 2x empty files in /etc/systemd/system that was preventing the service from installing...
[dns00 /opt/dnscrypt-proxy]# ls /etc/systemd/system
dnscrypt-proxy.socket
dnscrypt-proxy.service
Removed the files and then -service install did the trick.
Thank you for your time @jedisct1 I really appreciate it!
That does not explain why logging doesn't work with normal systemd files.
My bad, my system is configured with syslog.