大网数据广告活动
服务器运维问答

powerdns recursor logging not working

· 52CE 我爱测

i am trying to setup a powerdns recursor with query logging to specific log file with rsyslog. When I set it up and try to query some address and look in the query log file, every line is doubled, it also happens in the journal. …

问题原文

原帖链接 · inbal stoli · CC BY-SA 4.0

i am trying to setup a powerdns recursor with query logging to specific log file with rsyslog. When I set it up and try to query some address and look in the query log file, every line is doubled, it also happens in the journal. I don't know what to do can somebody help me?

This is my configuration files summarized:

/etc/pdns-recursor/recursor.conf -

allow-from=192.168.4.0/24
forward-zones-recurse=.=8.8.8.8
local-address=192.168.4.102
log-timestamp=no
logging-facility=0
loglevel=5
quiet=no
security-poll-suffix=
setgid=pdns-recursor
setuid=pdns-recursor

/etc/rsyslog.conf -

/etc/rsyslog.conf section 2

in /usr/lib/systemd/system/pdns-recursor.service set execstart to:

ExecStart=/usr/sbin/pdns_recursor --daemon=no --write-pid=no --disable-syslog=no --log-timestamp=no

已采纳解答

原帖链接 · A. Darwin · CC BY-SA 4.0

You are logging everything twice because logging is configured twice.

In particular, the PowerDNS unit by default doesn't log to syslog:

Additionally, the Recursor can log to syslog on these systems. Logging to syslog is disabled in the unit file to prevent double logging

Source: https://doc.powerdns.com/recursor/running.html

whereas you set --disable-syslog=no, which means it's enabled.

Disable syslog at the unit level and restart the service.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-07-28)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。