I miss the old forum as I tried to search within Discourse but found nothing, but maybe I just do not know how as I am new (did like the old forum better).
I recently notice my server is using the wrong DNS and no longer obeyed my setting.
And I guess this is due many upgrades as I still use the /etc/network/interfaces for network settings.
This is my current interfaces:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary buildin network interface (LOCAL)
auto enp1s0
iface enp1s0 inet static
address 192.168.1.1
netmask 255.255.255.0
# The secondery 3c905 network interface (INTERNET)
#auto enp4s7
#iface enp4s7 inet dhcp
auto enp3s7
iface enp3s7 inet dhcp
dns-nameservers 9.9.9.9 1.1.1.1
But if I check the /etc/resolv.conf the DNS from my internet provider has been set.
I though (but maybe wrong) this would be 9.9.9.9 and 1.1.1.1 as set in the config.
If I read about the resolv.conf I get to check either systemd-resolve or resolvectl, but these give:
systemd-resolve --status
systemd-resolve: command not found
resolvectl status
Command ‘resolvectl’ not found, but can be installed with:
apt install systemd-resolved
Any help on how to set the DNS correctly, not the one getting via dhcp of the internet provider?
PS … the tag is networking_wireless but this has nothing to do with wireless. It’s just networking.
That has me a bit puzzled. When I upgraded my own vps which uses /etc/network/interfaces, it installed systemd-resolved which I had to work around before I could get DNS to work. But in your case, it doesn’t appear to be running, or even installed. It might be worth checking that you don’t have any other DNS-setting software installed, such as Network Manager or bind, as something must be overwriting the settings on boot.
Otherwise, we’ll have to see if someone else can throw light on this.
do-release-upgrade should have transitioned you to systemd-networkd, the purpose of do-release-upgrade and update-manager (its GUI) is exactly to handle such transitions during upgrade (though in the case of ifupdwon (which handles /etc/network/interfaces) there is a conscious decision to not touch it even though it is deprecated and unsupported in Ubuntu, to not automatically move you to netplan and leave it to you to do a manual transition) yet the move from the (also deprecated) resolvconf to systemd-networkd should have happened)
How exactly did you do the upgrade on that system ?
I always do the do-release-upgrade as advised (not using any GUI). I know sometimes it asks to upgrade etc files, which I not always do. Could this be the reason?
So systemd-networkd is the way to go, would this be an easy installation or upgrade from ifupdown?
You would have to install systemd-networkd and netplan (if they are not already) and translate your ifupdown config into a netplan.yaml file … though this is a risky task to do remotely indeed, if you can not be physically around the server to use the console when you mess up something, I’d leave it as it is until you can … but you should make sure to replace resolvconf with systemd-resolved in any case (use resolvectl to set it up properly, be careful to not log out before it all works when doing it remotely)
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
#Set manual ip address 241218
auto enp1s0
iface enp1s0 inet static
address 10.0.0.61
netmask 255.255.255.0
gateway 10.0.0.1
dns-nameservers 8.8.8.8 8.8.4.4
while
# Generated by NetworkManager
search hsd1.pa.comcast.net
nameserver 75.75.75.75
nameserver 75.75.76.76
nameserver 2001:558:feed::1
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 2001:558:feed::2
nameserver 2601:985:d80:4b0:1e93:7cff:fe6b:7910
Gee, I guess code tags don’t work here like they did at UF.