내 Ubuntu 클라이언트는 여전히 systemd-resolve에서 이전 DNS를 사용하고 있습니다. 실행하면 systemd-resolve --status
이전 DNS와 새 DNS를 찾습니다. 내 네트워크의 DHCP 범위 옵션을 사용하여 새 DNS가 설정되었습니다. 모든 RHEL 시스템을 성공적으로 업데이트했지만 Debian/Ubuntu systemd는 업데이트하지 않았습니다.
~에서systemd-resolve --status:
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.10.44 ( OLD )
192.168.10.69 ( NEW )
해결.conf
cat /etc/systemd/resolved.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details
[Resolve]
#DNS=
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes
구성 파일 구문 분석
# 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 "systemd-resolve --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
search example.com
/etc/systemd/네트워크/비었다.
systemd-networkd가 DHCP를 사용하여 systemd-resolve가 사용할 내용을 업데이트하는 Github systemd 저장소를 읽었기 때문에 systemd-resolved 및 systemd-networkd를 여러 번 다시 시작하려고 시도했습니다.
편집하다:
/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 "systemd-resolve --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
search example.com
편집 2:
최근 리뷰의 일환으로
/etc/netplan/50-cloud-init.yml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
ens3:
dhcp4: true
match:
macaddress: XX:XX:XX:XX:XX
set-name: ens3
답변1
NETWORK_FILE=/run/systemd/network/10-netplan-ens3.network
귀하의 의견에서 언급한 내용은 Netplan에서 생성된 구성 파일을 참조하는 것 같습니다 systemd-networkd
.
/etc/netplan/50-cloud-init.yml
Netplan의 주석은 다음에 의해 제어되는 것이 좋습니다 cloud-init
.
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
따라서 cloud-init는 이를 푸시 50-cloud-init.yml
하고 /etc/netplan
수정하면 다시 변경할 수 있습니다. 그런데 이게?모두응? 로그 파일에서 /var/log/cloud-init*.log
영감을 얻을 수 있습니다.
cloud-init가 이전 DNS 설정을 강제로 추가하는 것으로 밝혀지면 cloud-init가 네트워크 설정을 방해하지 않도록 하는 방법도 이미 알려줍니다.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}