/etc/resolv.conf 在启动时未填充,仅在后续重新启动后填充

/etc/resolv.conf 在启动时未填充,仅在后续重新启动后填充

我们有一个在 Proxmox 6.3 上运行的 Ubuntu Server 16.04.7 虚拟机。

重新启动主机时,该机器出现“空”状态/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

如果我随后重新启动该虚拟机,/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
nameserver 192.168.100.10
nameserver 192.168.100.11
search domain.com

/etc/network/interfaces如下:

auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
    address 192.168.100.189
    netmask 255.255.255.0
    network 192.168.100.0
    broadcast 192.168.100.255
    gateway 192.168.100.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 192.168.100.10 192.168.100.11
    dns-search domain.com

resolvconf已安装,我找不到此安装与我们拥有的许多其他虚拟机之间的任何有意义的差异。/etc/resolvconf此机器上的内容与同一节点上的另一台工作机器相同;我们没有编辑文件resolv.conf.d

我们也在这个节点上运行keepalived,配置如下:

vrrp_instance VI_1 {
    state BACKUP
    interface ens18
    virtual_router_id 188
    priority 150
    advert_int 1
    notify /script/to/start/and/stop/fetchmail
    virtual_ipaddress {
        192.168.100.188
    }
}

基本上/script/to/start/and/stop/fetchmail就像它所说的那样:根据该节点是否是主节点来启动和停止 fetchmail 的脚本。

我该从哪里开始寻找解决(故意双关语!)这个问题呢?

相关内容