Ubuntu 19.04中的DNS问题

塞绍

在最新的Ubuntu更新后(可能是由于我的系统中安装了pihole),服务器无法解析地址。我完全卸载了pihole,但问题仍然存在。我看到在最新的Ubuntu版本中使用了netplan,所以我尝试像这样配置yaml文件

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      addresses:
        - 192.168.5.20/32
      gateway4: 192.168.5.1
      nameservers:
          search: [local]
          addresses: [192.168.5.1]

我应用了配置,并在system-resolve --status命令中应用了正确的配置。指向的dns服务器正在工作,因为我的所有设备/电话/ nas / etc都在正常工作。

我在/etc/systemd/resolved.conf之后尝试编辑,但是问题仍然存在。暂时解决此问题的唯一方法是仍然使用同一dns服务器修改/etc/resolved.conf,并且地址似乎可以正常解决。问题在于,每次重新启动时,配置都会丢失,并被127.0.0.1取代,并且系统停止解析地址。在不重新安装所有内容的情况下如何完全恢复网络配置的任何帮助吗?

在pkg -l dnsmasq之后,我得到:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name             Version       Architecture Description
+++-================-=============-============-================================
un  dnsmasq          <none>        <none>       (no description available)
ii  dnsmasq-base     2.80-1ubuntu1 amd64        Small caching DNS proxy and DHCP
un  dnsmasq-base-lua <none>        <none>       (no description available)

在ls -al /etc/resolv.conf之后,我得到:

lrwxrwxrwx 1 root root 29 May  4 00:48 /etc/resolv.conf -> ../run/resolvconf/resolv.conf

在cat /etc/resolv.conf之后

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 192.168.5.13
search local

在cat / etc / network / interfaces之后:

 ifupdown has been replaced by netplan(5) on this system.  See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
#    sudo apt install ifupdown

之后cat /etc/systemd/resolved.conf

#  This file is part of systemd.

...

[Resolve]
DNS=192.168.5.1
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#DNSOverTLS=no
#Cache=yes
#DNSStubListener=yes
#ReadEtcHosts=yes

在命令system-resolve --status之后,我得到:

   Global
       LLMNR setting: no
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.5.1
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      18.172.in-addr.arpa
                      19.172.in-addr.arpa
                      20.172.in-addr.arpa
                      21.172.in-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp
                      d.f.ip6.arpa
                      home

在cat /etc/NetworkManager/NetworkManager.conf之后:

there's a blank line only displayed.

在sudo systemctl status systemd-resolved之后,我得到了:

Systemd-resolved.service - Network Name Resolution
   Loaded: loaded (/lib/systemd/system/systemd-resolved.service; enabled; ve
   Active: active (running) since Sun 2019-07-28 15:39:52 CEST; 4h 44min ago
     Docs: man:systemd-resolved.service(8)
           https://www.freedesktop.org/wiki/Software/systemd/resolved
           https://www.freedesktop.org/wiki/Software/systemd/writing-network
           https://www.freedesktop.org/wiki/Software/systemd/writing-resolve
 Main PID: 3349 (systemd-resolve)
   Status: "Processing requests..."
    Tasks: 1 (limit: 4915)
   Memory: 2.4M
   CGroup: /system.slice/systemd-resolved.service
           └─3349 /lib/systemd/systemd-resolved

Jul 28 15:39:51 plex systemd[1]: Starting Network Name Resolution...
Jul 28 15:39:52 plex systemd-resolved[3349]: Positive Trust Anchors:
Jul 28 15:39:52 plex systemd-resolved[3349]: . IN DS 19036 8 2 49aac11d7b6f6
Jul 28 15:39:52 plex systemd-resolved[3349]: . IN DS 20326 8 2 e06d44b80b8f1
Jul 28 15:39:52 plex systemd-resolved[3349]: Negative trust anchors: 10.in-a
Jul 28 15:39:52 plex systemd-resolved[3349]: Using system hostname 'plex'.
Jul 28 15:39:52 plex systemd[1]: Started Network Name Resolution.


是的,重新启动后它将更改为127.0.0.1

猫/run/systemd/resolve/resolv.conf给我:

# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 192.168.5.1
search local

猫/run/systemd/resolve/stub-resolv.conf给我:

# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0
search local

sudo lshw -C网络给我:



  *-network                 
       description: Wireless interface
       product: Wireless 8265 / 8275
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:3a:00.0
       logical name: wlp58s0
       version: 78
       serial: f8:63:3f:08:69:43
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=5.0.0-20-generic firmware=36.9f0a2d68.0 latency=0 link=no multicast=yes wireless=IEEE 802.11
       resources: irq:129 memory:dc100000-dc101fff
  *-network
       description: Ethernet interface
       product: Ethernet Connection (4) I219-V
       vendor: Intel Corporation
       physical id: 1f.6
       bus info: pci@0000:00:1f.6
       logical name: eno1
       version: 21
       serial: f4:4d:30:6a:0d:e7
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=0.1-4 ip=192.168.5.20 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:125 memory:dc280000-dc29ffff
  *-network:0
       description: Ethernet interface
       physical id: 2
       logical name: br-c20159f39807
       serial: 02:42:82:dc:5c:c1
       capabilities: ethernet physical
       configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.18.0.1 link=yes multicast=yes
  *-network:1
       description: Ethernet interface
       physical id: 3
       logical name: veth3e14a42
       serial: 4e:59:53:86:1b:a8
       size: 10Gbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.130.45 link=yes multicast=yes port=twisted pair speed=10Gbit/s
  *-network:2
       description: Ethernet interface
       physical id: 4
       logical name: vethb1a5fa9
       serial: ea:45:16:b6:ee:13
       size: 10Gbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.6.237 link=yes multicast=yes port=twisted pair speed=10Gbit/s
  *-network:3
       description: Ethernet interface
       physical id: 5
       logical name: docker0
       serial: 02:42:18:4e:ed:2f
       capabilities: ethernet physical
       configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.17.0.1 link=no multicast=yes
  *-network:4
       description: Ethernet interface
       physical id: 6
       logical name: veth1f469d7
       serial: 46:51:7b:28:7a:11
       size: 10Gbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.74.93 link=yes multicast=yes port=twisted pair speed=10Gbit/s
  *-network:5
       description: Ethernet interface
       physical id: 7
       logical name: vethcd445dd
       serial: 26:6e:38:e2:da:1f
       size: 10Gbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.168.110 link=yes multicast=yes port=twisted pair speed=10Gbit/s
  *-network:6
       description: Ethernet interface
       physical id: 8
       logical name: veth9810524
       serial: ee:a9:1f:d7:e3:b7
       size: 10Gbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.61.7 link=yes multicast=yes port=twisted pair speed=10Gbit/s
  *-network:7
       description: Ethernet interface
       physical id: 9
       logical name: veth538f6bc
       serial: 5e:b5:25:5c:b9:5d
       size: 10Gbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.52.246 link=yes multicast=yes port=twisted pair speed=10Gbit/s
  *-network:8
       description: Ethernet interface
       physical id: a
       logical name: br-03e193556b79
       serial: 02:42:77:59:85:26
       capabilities: ethernet physical
       configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.20.0.1 link=yes multicast=yes
  *-network:9
       description: Ethernet interface
       physical id: b
       logical name: vethb3f499f
       serial: 6a:be:8c:01:13:ec
       size: 10Gbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.196.173 link=yes multicast=yes port=twisted pair speed=10Gbit/s
  *-network:10
       description: Ethernet interface
       physical id: c
       logical name: vethb56cefe
       serial: 6a:74:3a:90:6b:60
       size: 10Gbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full ip=169.254.82.220 link=yes multicast=yes port=twisted pair speed=10Gbit/s

血淋巴瘤

从评论中...

在安装并移除pihole之后,DNS不再起作用。我们通过以下方式更改了/run/resolvconf/resolv.conf用于的符号链接/etc/resolv.conf...

sudo rm -i /etc/resolv.conf

sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

在 Ubuntu 19 中找不到 Atom PPA

来自分类Dev

Ubuntu 14.04中的DNS问题

来自分类Dev

Ubuntu 19.04中的DNS问题

来自分类Dev

Ubuntu 17.10中的DNS问题

来自分类Dev

Ubuntu 19上的coredumpctl

来自分类Dev

Ubuntu 13.10中的内核3.11.0-19-generic出现问题

来自分类Dev

Ubuntu 16.04 DNS解析中的问题

来自分类Dev

在 Ubuntu 19 上使用 FFMPEG 运行私有应用程序时出现问题

来自分类Dev

Ubuntu DNS 问题

来自分类Dev

在我的Dell All-In-One 19中安装Ubuntu后,网卡不起作用

来自分类Dev

在我的Dell All-In-One 19中安装Ubuntu后,网卡不起作用

来自分类Dev

Ubuntu 19:耳机插孔无声音-音频

来自分类Dev

USB 问题 - WD19TB 扩展坞 - 戴尔 XPS 15 笔记本电脑 - Ubuntu 20.04

来自分类Dev

在Ubuntu 13.04中连接到VPN时遇到DNS问题

来自分类Dev

在Ubuntu 13.04中连接到VPN时遇到DNS问题

来自分类Dev

Ubuntu 17.04奇怪的DNS问题

来自分类Dev

Ubuntu 17.04奇怪的DNS问题

来自分类Dev

Thinkpad X1 Carbon的内置扬声器在Ubuntu 18和19中不会改变音量

来自分类Dev

Ubuntu 13.10中的内部错误/ ProblemType:KernelOops /软件包:linux-image-3.11.0-19-generic 3.11.0-19.33

来自分类Dev

Thinkpad X1 Carbon的内置扬声器在Ubuntu 18和19中不会改变音量

来自分类Dev

API 19 Android中的OnNewIntent

来自分类Dev

如何在Ubuntu 18/19上升级Elixir版本

来自分类Dev

不显示任何分区来安装 Ubuntu 19

来自分类Dev

Ubuntu 19 LTS 的当前状态是什么?

来自分类Dev

Ubuntu 19 如何设置不同的显示器缩放

来自分类Dev

在张量流中连接vgg19的问题

来自分类Dev

19位长整数的截断问题

来自分类Dev

安装fedora 19时出现问题

来自分类Dev

在Ubuntu 20.04上使用OpenVPN的DNS问题

Related 相关文章

热门标签

归档