DNS assistance please

Speedster

Honorary Master
Joined
May 2, 2006
Messages
32,047
Reaction score
21,402
Location
Hatfield
Could one of you linux superhero gurus perhaps help me out, please? I'm running a home server on Debian and since a couple of weeks ago it doesn't have a working DNS setting upon rebooting. I'm able to get things working by editing /etc/resolv.conf but this only lasts until the next reboot. I've looked all around online but can't find a solution that seems to work. Anyone know how I can fix this?
 
There's no /etc/netplan/

I have /etc/netconfig/, /etc/network/, /etc/NetworkManager/ and /etc/networks/
 
Does your /etc/resolv.conf reset?

Or are the settings just not adhered to?

Try running “chattr +i /etc/resolv.conf” after setting it up again.
 
Does your /etc/resolv.conf reset?

Or are the settings just not adhered to?

Try running “chattr +i /etc/resolv.conf” after setting it up again.
It resets. After every reboot it just says: "# Generated by NetworkManager"
 
Then that command should lock it out.

Otherwise just do it with Networkmanager.

First prize and easiest is “nmtui” which you may need to install.

Otherwise.

Code:
nmcli con mod $connectionName ipv4.dns “$DNS1 $DNS2”

Run just “nmcli con” to get the connection name.
 
I've added a file named /etc/NetworkManager/conf.d/DontTouchDNSResolution.conf with the following contents:
Code:
[main]
dns=none
systemd-resolved=false

This seems to have worked.
 
Then that command should lock it out.

Otherwise just do it with Networkmanager.

First prize and easiest is “nmtui” which you may need to install.

Otherwise.

Code:
nmcli con mod $connectionName ipv4.dns “$DNS1 $DNS2”

Run just “nmcli con” to get the connection name.
nmcli was showing the correct info, it just wasn't writing to resolve.conf correctly. Anyway, they dontTouch thing seems to have done the trick
 
Another way would be to prevent any changes to /etc/resolv.conf:
# chattr +i /etc/resolv.conf
 
Could one of you linux superhero gurus perhaps help me out, please? I'm running a home server on Debian and since a couple of weeks ago it doesn't have a working DNS setting upon rebooting. I'm able to get things working by editing /etc/resolv.conf but this only lasts until the next reboot. I've looked all around online but can't find a solution that seems to work. Anyone know how I can fix this?
I assume this isnt a Desktop Experience environment?
 
It gets overwritten on each reboot so add to /etc/resolvconf/resolv.conf.d/head
 
Top
Sign up to the MyBroadband newsletter
X