/etc/resolv.conf keeps getting erased

Before posting something, READ the changelog, WATCH the videos, howto and provide following:
Your install is: Bare metal, ESXi, what CPU model, RAM, HD, what EVE version you have, output of the uname -a and any other info that might help us faster.

Moderator: mike

Post Reply
cgwkml
Posts: 2
Joined: Mon Feb 19, 2024 11:14 am

/etc/resolv.conf keeps getting erased

Post by cgwkml » Fri Mar 01, 2024 4:04 pm

Hello community,

I have EVE-NG Community installed on a laptop (bare install), and I wanted to configure one NIC for Internet access, with static settings.
My issue is that /etc/resolv.conf file keeps getting erased. As far as I can tell, I happens every time a network interface goes down or up.
When I say erased, I mean it reverts to:
nameserver 127.0.0.53
options edns0 trust-ad

Eve-ng details:
uname -a == Linux eve-ng 5.17.8-eve-ng-uksm-wg+ #1 SMP PREEMPT Mon May 16 10:08:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
dpkg -l eve-ng : version 5.0.1-19 Architecture amd64

I followed some advices from the internet and:
- auditctl -w /etc/resolv.conf -p w doesn't help. Nothing related to that file in the logs
- added
supersede domain-name "my.domain.com";
prepend domain-search "my.domain.com";
to etc/dhcp/dhclient.conf but didn't help.
- If I try to use DHCP, /var/run/NetworkManager/resolv.conf gets populated with the nameservers assigned by my home router but /etc/resolv.conf keeps getting erased
- edited /etc/NetworkManager/NetworkManager.conf and added
[main]
dns=none
didn't help at all.
- edited /etc/systemd/resolved.conf and added
[Resolve]
DNS=1.1.1.1
still nothing. resolv.conf keeps getting erased and name resolution fails

Could you please tell me how do I fix this, or if there is any workaround to this ?

cgwkml
Posts: 2
Joined: Mon Feb 19, 2024 11:14 am

Re: /etc/resolv.conf keeps getting erased

Post by cgwkml » Thu Mar 07, 2024 3:19 pm

I found that is systemd-resolved who keeps rewriting /etc/resolv.conf
Didn't manage to make it work, even though I configured it and I eventually gave up:
- disabled it completly
systemctl disable systemd-resolved
systemctl stop systemd-resolved

- configured NetworkManager to not interfere with DNS settings:
/etc/NetworkManager/NetworkManager.conf
[main]
dns=none

- manually configured a couple of DNS addresses in /etc/resolv.conf

Now it works like a charm

rusty725
Posts: 146
Joined: Thu Mar 29, 2018 4:19 pm

Re: /etc/resolv.conf keeps getting erased

Post by rusty725 » Mon Apr 01, 2024 10:31 pm

this is wrong , do not edit resolv.conf at all, what you need to use is the IP prompt.
turn off all nodes first, then run these 2 commands in the Eve terminal then do a manual setup of ip, subnet mask, dns, etc etc.

rm -f /opt/ovf/.configured
su -

Post Reply