如何在 Ubuntu 17.04 中禁用 systemd-resolved?
禁用它systemctl disable不起作用,该服务似乎已重新启动(由 Networkmanager?)
我刚刚安装了一个新的 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 …Run Code Online (Sandbox Code Playgroud) 当我通过 Gnome 网络管理器连接到 VPN 网络时,我丢失了 DNS 解析,实际上,我无法访问 VPN 网络内部或外部的资源。
当我使用 Ubuntu 16.04 并使用 VPN 时,“ /etc/resolv.conf/”文件将包含我连接的 (VPN) 网络的 DNS 服务器。现在它总是包含以下条目:
nameserver 127.0.0.53
search myprovider.com
Run Code Online (Sandbox Code Playgroud)
据我127.0.0.53所知,system-resolved.
我怀疑这是一个错误,因为 VPN 在 Ubuntu 16.04 上运行良好。当我使用 VPN 服务时,有什么方法可以设置我网络的 DNS 服务器?
更新:
我尝试使用帖子末尾附加的配置文件连接到 OpenVPN 网络,但出现以下错误:
Authenticate/Decrypt packet error: cipher final failed
Run Code Online (Sandbox Code Playgroud)
我已经验证服务器使用 lzo 压缩并且我也启用了它。连接保持活动状态,但我无法导航到 VPN 内部或外部的任何页面。
在下面列出的配置文件中,我已经包含了回复中发布的解决方案
client
dev tun
proto udp
remote openvpn.bibsys.no 1194
remote my-server-2 1194
resolv-retry infinite
nobind
user myuser
group myuser
persist-key
persist-tun
ca ca-cert.pem
cert openvpn.crt …Run Code Online (Sandbox Code Playgroud) 我最近升级到 17.10。当我尝试浏览某个网站或 ping 一个域时,它失败并说该站点无法解析。
network-admin示出的内容/etc/resolv.conf是nameserver: 127.0.0.53
如果我将其更改为 8.8.8.8 或 208.67.222.222,则一切正常。直到我重新启动。
重新启动或恢复后,名称服务器将重置为 127.0.0.53。
如何将名称服务器永久设置为有效?
对于 systemd 粉丝,如果我运行,systemd-resolve --status我会得到
Link 3 (wlo1)
Current Scopes: LLMNR/IPv4 LLMNR/IPv6
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Run Code Online (Sandbox Code Playgroud)
如果我按照此问题的建议进行操作 - DNS 在重新启动后会不断重置。Ubuntu 17.10 - DNS 仍然无法解析。
我正在学习一些教程。当我尝试systemd-resolve --status在 Ubuntu 22.04 桌面上执行时,系统报告找不到命令。我在这里做错了什么?
我尝试运行sudo apt-get install -y systemd,但似乎未安装systemd-resolve 。请帮忙。
Ubuntu 16.10+systemd-resolved用作 DNS 解析器。
我更喜欢将 setup 16.04dnsmasq用作解析器。
我怎么能在 16.10+ 上做到这一点,尤其是在 17.04 上?
我最近将我的 Xubuntu 从 16.10 升级到 17.04。
除了 systemd-resolv 之外,一切都运行良好。有时它会使 cpu 使用率过高,我不知道为什么会发生这个问题。
这是top命令输出:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1114 systemd+ 20 0 51532 6744 4504 R 100 0.0 9:51.67 systemd-resolve
1152 dnsmasq 20 0 64360 2892 2480 R 38.9 0.0 4:05.53 dnsmasq
1245 root 20 0 376644 89644 64436 S 1.7 0.5 0:35.69 Xorg
1624 asus 20 0 370160 45820 28488 S 0.7 0.3 0:00.90 python2
2238 asus 20 0 2562816 553112 …Run Code Online (Sandbox Code Playgroud) 我正在使用一个 VPN 客户端,它将两个名称服务器添加到/etc/resolv.conf. 我所有的连接都由网络管理器管理。
我必须将此 VPN 客户端用于我的工作 VPN,但是在 Ubuntu systemd-resolved16.10进入后,我的连接和 DNS 出现问题。看起来由于某种原因systemd-resolved更改/etc/resolv.conf回默认名称服务器,这使得内部页面无法解析。我进一步研究了这个并最终替换resolvconf为openresolv. 这有很大帮助,但在 VPN 启动一段时间后仍会systemd-resolved重置/etc/resolv.conf。
这可能是因为连接已建立或几分钟后,有时甚至根本没有。然后我禁用systemd-resolved和systemd resolvconf.service只有运行openresolv。看起来一切都很好。
然而,这一切都非常令人困惑。是否有理由systemd-resolved与其中之一一起使用?它在 Ubuntu 16.10 中启用,所以我认为一定有原因,但它似乎引起了/etc/resolv.conf.
如果我可以跑步operesolv并得到解释,那就太好了。我已经对它进行了大量阅读,但我仍然不明白为什么/etc/resolv.conf要这样管理,只是当我使用systemd它时,我无法使用我的 VPN 客户端。
我想使用 dnsmasq 获得快速的 dns 解析并保持默认的 systemd-resolved。
寻找一种优雅的方式来做到这一点
我的 NetworkManager 连接到互联网,但由于 DNS 配置错误,我无法访问互联网。我对 DNS 设置没有太多经验,但问题似乎是由 systemd 解决的。我可以直接 ping IP 地址(例如 8.8.8.8)并正常获得响应,但使用下面的默认配置时无法解析域。我尝试了指向 systemd-resolved 文档中列出的三种配置模式的符号链接,但它们都不起作用。
无法使用以下命令解析任何域,但我可以 ping IP(尝试了很多,它们都有效),没有任何问题。
# /etc/resolv.conf
nameserver 127.0.0.53
options edns0 trust-ad
Run Code Online (Sandbox Code Playgroud)
使用 dig 或 host 时我也会遇到超时错误。
; <<>> DiG 9.16.1-Ubuntu <<>> www.ubuntu.com
;; global options: +cmd
;; connection timed out; no servers could be reached
Run Code Online (Sandbox Code Playgroud)
我可以通过将 resolv.conf 名称服务器更改为 8.8.8.8 来获得域解析并连接到互联网,但解析需要很长时间,即使网络速度测试报告超过 100 mbps 和 ping,网页也需要 >1 分钟才能加载在同一台机器上 <30 毫秒。
下面的配置可以工作,但响应时间非常慢
# /etc/resolv.conf
nameserver 8.8.8.8
options edns0 trust-ad
Run Code Online (Sandbox Code Playgroud)
就像我说的,我是这些系统的新手,我正在努力解决问题。以下是我认为可能有用的所有内容。以下所有输出均使用名称服务器 127.0.0.53
Ubuntu 20.04.3 LTS
systemd-resolve --status 的输出
Global …Run Code Online (Sandbox Code Playgroud) systemd-resolved ×10
dns ×9
dnsmasq ×2
systemd ×2
16.10 ×1
17.04 ×1
22.04 ×1
internet ×1
networking ×1
openvpn ×1
resolv.conf ×1
server ×1
tor ×1
vpn ×1
xubuntu ×1