【Ubuntu】「directory /etc/resolv.conf for resolv-file is missing, cannot poll」のエラーが出た時の対処方法!

「dnsmasq」を起動しようとしたところ、エラーが…。

× dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
     Loaded: loaded (/lib/systemd/system/dnsmasq.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2022-08-27 22:16:30 JST; 23s ago
    Process: 1228 ExecStartPre=/etc/init.d/dnsmasq checkconfig (code=exited, status=0/SUCCESS)
    Process: 1237 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=5)
        CPU: 292ms

Aug 27 22:16:30 raspberrypi systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Aug 27 22:16:30 raspberrypi dnsmasq[1237]: dnsmasq: directory /etc/resolv.conf for resolv-file is missing, cannot poll
Aug 27 22:16:30 raspberrypi dnsmasq[1237]: directory /etc/resolv.conf for resolv-file is missing, cannot poll
Aug 27 22:16:30 raspberrypi dnsmasq[1237]: FAILED to start up
Aug 27 22:16:30 raspberrypi systemd[1]: dnsmasq.service: Control process exited, code=exited, status=5/NOTINSTALLED
Aug 27 22:16:30 raspberrypi systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
Aug 27 22:16:30 raspberrypi systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
目次

対処方法

以下のコマンドで、「systemd-resolved」サービスを停止させる。

sudo systemctl stop systemd-resolved
sudo systemctl disable systemd-resolved

改めて、「dnsmasq」を起動。

sudo systemctl start dnsmasq.service

きっとこれで完了。

よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!
目次