Ubuntu Server 20.04.3 LTS 00-installer-config.yaml 或 resolv.conf 用于 DNS 设置

Ubuntu Server 20.04.3 LTS 00-installer-config.yaml 或 resolv.conf 用于 DNS 设置

所以我非常困惑。我正在尝试为我们的域指定本地 DNS 服务器。此 Ubuntu Server 20.04.3 不使用旧的接口文件。我为 netplan 配置了 yaml 文件,

    # This is the network config written by 'subiquity'
network:
  bonds:
    bond0:
      addresses:
      - 172.17.17.71/24
      gateway4: 172.17.17.1
      interfaces:
      - eno1
      - eno2
      nameservers:
        addresses:
        - 172.17.17.31
        - 172.17.17.41
        - 172.17.17.51
        - 172.17.17.61
        search:
        - local.mydomain.com
      parameters:
        mode: balance-rr
  ethernets:
    eno1: {}
    eno2: {}
    eno3:
      dhcp4: true
    eno4:
      dhcp4: true
  version: 2

但这似乎也没有设置新的 DNS 服务器,systemd 元素也没有。如果我尝试状态:

admin@ubu:/$ resolvectl status
Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.

我必须重新启动 systemd:

admin@ubu:/$ systemctl restart systemd-resolved
admin@ubu:/$ resolvectl status

现在状态有效。

Global
       LLMNR setting: no
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
          DNS Domain: local.mydomain.com
          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
                      internal
                      intranet
                      lan
                      local
                      private
                      test

Link 6 (bond0)
      Current Scopes: DNS
DefaultRoute setting: yes
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 172.17.17.31
                      172.17.17.41
                      172.17.17.51
                      172.17.17.61
          DNS Domain: local.mydomain.com

Link 5 (eno4)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 4 (eno3)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 3 (eno2)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 2 (eno1)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

我尝试过编辑/etc/resolv.conf以对 DNS 服务器进行硬编码,这确实有效,并且更改了状态中显示的全局 DNS 列表(文件本身说我不应该编辑它!)并且编辑 netplan 的 yaml 文件会更改 bond0 的 DNS 列表。状态的 bond0 部分中的 DNS 列表似乎对失败的网络驱动器映射没有影响。

所以我有三个问题。

  1. Systemd 在启动时无法正确启动。
  2. netplan 似乎没有发挥其应有的作用,因为 DNS 似乎无法发挥作用。
  3. /etc/resolv.conf不应被编辑。

我该怎么做才能解决这个网络混乱问题?

相关内容