
systemd-resolved
Oracle Linux 7.6에서 사용을 시작하고 싶습니다 .
그냥 컨텐츠로 가지고 있는 /etc/resolv.conf
심볼릭 링크인 모드에서 사용하고 싶습니다 ./run/systemd/resolve/stub-resolv.conf
nameserver 127.0.0.53
systemd-networkd
설치 하고 패키지를 만들었습니다 systemd-resolved
. 관련 서비스를 활성화하고 서비스를 비활성화 NetworkManager
했습니다 network
.
그러나 내 설치에는 systemd-resolved
이 스텁 파일이 포함되어 있지 않습니다 /run/systemd/resolve/stub-resolv.conf
. 그것은 단지 /run/systemd/resolve/resolv.conf
.
제가 왜 없어졌는지 조언해 주실 수 있나요 stub-resolv.conf
?
답변1
나는 Ubuntu 20.04 LTS에서 동일한 문제에 여러 번 직면했는데 이는 자동으로 또는 고의로 중지된 systemd-resolved.service 때문이었습니다. 서비스를 시작한 후 /run/systemd/resolv/stub-resolv.conf 파일이 다시 나타납니다.
답변2
나는 Debian 9에서 동일한 문제를 관찰하고 있습니다. (man 8 systemd-resolved.service)에 따르면:
o A static file /usr/lib/systemd/resolv.conf is provided that lists the 127.0.0.53 DNS stub (see above) as only DNS server. This file may be symlinked from /etc/resolv.conf in order to connect all local clients that bypass local DNS APIs to systemd-resolved. This mode of operation is recommended.
실제로는 그렇지 않습니다. 파일은 /lib/systemd/resolv.conf에 있습니다. 그리고 이것은 검색 도메인이 없는 로컬 스텁 서버를 가리키는 일반 정적 파일입니다.
systemd-resolved의 Debian 10 버전으로 업그레이드하면 232에서 241로 이동합니다. 그러면 올바른 스텁 파일이 활성화됩니다: /run/systemd/resolve/stub-resolv.conf
나는 당신이 Debian 9에서와 유사한 systemd-resolved 버전을 사용하고 있다고 생각합니다. 당신의 man을 확인하고 find를 사용하여 resolv.conf 파일을 찾으십시오.