Gre*_*ltz 103 server dns systemd-resolved
我刚刚安装了一个新的 Ubuntu Server 18.04。我设置了我的主机名hostnamectl set-hostname ****.openbayou.biz
并设置了/etc/hosts
:
127.0.0.1 localhost
[ip address] ****.openbayou.biz hostname
# The following lines are desirable for IPv6 capable hosts
[ip6 address] *****.openbayou.biz hostname
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Run Code Online (Sandbox Code Playgroud)
我还安装了 OSSEC 来监控服务器的新文件、错误和更改,现在我收到了这些警报:
Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-
0001, retrying transaction with reduced feature level UDP.`
Run Code Online (Sandbox Code Playgroud)
它现在重演:
systemd-resolved[3195]: message repeated 4 times: [ Server returned error
NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction
with reduced feature level UDP.]
Run Code Online (Sandbox Code Playgroud)
我在网上寻找解决方案,但没有人报告此问题。
小智 81
当 DNS 系统无法解析名称时,systemd-resolved 会记录此警告(例如 nslookup www.kjfoiqaefah34876asdf.com)。这是可以容忍的,没有理由惊慌。这不是错误,无需修复。
重定向/etc/resolv.conf
到/run/systemd/resolve/resolv.conf
是错误的,因为这种方式systemd-resolved
被跳过,具有错误 DNS 请求的应用程序直接与名称服务器对话,而不再与systemd-resolved
存根对话。这种方式systemd-resolved
不会再注意到 NXDOMAIN 事件,因此无法再记录它。
NXDOMAIN 事件是由程序包引起的,这些程序包在系统启动期间尝试访问不存在的服务器。
Pan*_*kis 55
重要提示:此处发布的解决方案通过绕过系统的重要部分(DNS 解析器守护程序)隐藏了有问题的消息。将来可能会导致 DNS 故障(示例)。有关处理错误消息的正确方法,请参阅此答案。
Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-
0001, retrying transaction with reduced feature level UDP.
Run Code Online (Sandbox Code Playgroud)
同样的错误发生在我的台式机上,我不知道它是否也适用于服务器。
似乎我的系统有旧配置,导致两个服务之间发生冲突:resolvconf
和systemd-resolved
.
符号链接/etc/resolv.conf
指向../run/resolvconf/resolv.conf
将其更改/run/systemd/resolve/resolv.conf
为由 systemd 管理的指向,为我修复了它。
在 Ubuntu 论坛上阅读更多信息
希望有所帮助。
Gre*_*ltz 15
我在 OSSEC GitHub 上询问了这个错误,他们建议编写一个规则来忽略 NXDOMAIN 错误。添加/var/ossec/rules/local_rules.xml
<rule id="234567" level="0">
<program_name>systemd-resolved</program_name>
<match>Server returned error NXDOMAIN</match>
<description>Usless systemd-resolvd log message</description>
</rule>
Run Code Online (Sandbox Code Playgroud)
F1L*_*nux 13
尽管可能在其他情况下会发生此错误,但我可以肯定地说,我已经在以下输出中看到了它:
systemctl status systemd-resolved
Run Code Online (Sandbox Code Playgroud)
...何时systemd-resolved
未配置。
并且Azure Ubuntu 18.04 VM 尚未systemd-resolved
配置开箱即用(截至今天,20191008)。
配置systemd-resolved
.
systemd-resolved
配置方法:注意:以下说明是使用Ubuntu 18.04准备的
通过预先将 systemd-resolved 设置为将被咨询的 DNS 解析的第一个来源来编辑hosts
指令:/etc/nsswitch.conf
resolve
hosts: resolve files dns
Run Code Online (Sandbox Code Playgroud)
编辑/etc/systemd/resolved.conf
。一些建议的设置:
[Resolve]
DNS=8.8.8.8 8.8.4.4
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
Cache=yes
DNSStubListener=yes
Run Code Online (Sandbox Code Playgroud)
重新启动systemd-resolved
:
sudo systemctl restart systemd-resolved
Run Code Online (Sandbox Code Playgroud)
当您下次检查systemd-resolved
的状态时,现在应该清除错误:
systemctl status systemd-resolved
Run Code Online (Sandbox Code Playgroud)
DNS 解析现在应该以预期的方式运行。
小智 12
我在最近更新到 18.04.1 的 Ubuntu 18.04 服务器上注意到了同样的事情。
似乎 systemd-resolve 会在收到任何 NXDOMAIN 响应时记录该消息。就我而言,我运行了 postfix。所以当随机服务器连接没有 PTR 记录集时,我得到了很多 NXDOMAINS。
你可以用
systemd-resolve securelogin.example.com
Run Code Online (Sandbox Code Playgroud)
然后您应该会看到日志消息出现。
考虑到这一点,它似乎是一个相对无害的错误,您可以忽略它。
在阅读了之前的答案和其他网页(例如Ubuntu 18.04 systemd-resolved error NXDOMAIN)后,我的理解是,这与其说是错误,不如说是警告,对此我无能为力。
因此,我同意那些说我们不应该尝试做我们这边的事情以便不再产生这些信息的人。如果我们成功了,很可能我们已经改变了系统解析 DNS 请求的正常方式。
但是,由于我有数千个(我也在台式机中 - 它不是服务器),我不希望它们出现在我的 syslog 文件中。因此,按照https://www.rsyslog.com/doc/v8-stable/configuration/filters.html和Number pair prefix to config files,我在目录中添加了一个以10-resolv.conf
单行命名的文件 。:msg, contains, "Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP" ~
/etc/rsyslog.d
名称10-resolv.conf
并不重要,但它必须按字母顺序在目录中的所有其他文件名之前。该命令:msg, contains, <message-part> ~
表示必须忽略包含 <message-part> 的所有消息:~
命令中的波浪号表示删除消息。
补充说明:由于我写了这个答案,我安装了一些软件包(出于其他原因)并且不再产生错误消息,因为使用journalctl -u systemd-resolved -f
. 可以解释此消息消失的一个已安装软件包是 libnss-resolve。
归档时间: |
|
查看次数: |
170018 次 |
最近记录: |