[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/resolv.conf changes every booting time



On Sun, Aug 06, 2023 at 05:17:23PM +0800, Jon Smart wrote:
> It's a VPS provided by a local ISP. The VPS has a static IPv4.
> Do you know how to know if /etc/resolv.conf is modified by dhcp?

The first thing you could do is check whether a DHCP client daemon
is running.  That's usually a sign.

Failing that, find out what your primary network interface's name is,
and then find out how that network interface is brought up.  In a server
configuration, it's *usually* brought up by a stanza in the
/etc/network/interfaces file.  If that stanza consists of a line
ending with "dhcp", then voila.

If the primary network interface is not configured in /e/n/i then the
second most likely configuration is NetworkManager.  Usually if NM
is in the picture, /etc/resolv.conf will be a symlink, and you will
see evidence of NM both in the symlink's target, and in the contents
of the file.  Thus,

    ls -ld /etc/resolv.conf
    cat /etc/resolv.conf

Both of these should give you hints, if NM is involved.


Reply to: