Hi,
I have a fairly standard network configuration:
networking = {
useDHCP = false;
hostName = "jaghut";
interfaces.enp6s0.useDHCP = true;
interfaces.enp7s0.useDHCP = true;
networkmanager = {
enable = true;
plugins = with pkgs; [
networkmanager-openvpn
networkmanager-openconnect
];
};
defaultGateway = "10.0.0.138";
nameservers = [ "1.1.1.1" "8.8.8.8" ];
firewall.allowedTCPPorts = [ 32400 ]; # Plex
};
I am using network manager with the protonvpn linux app to connect to VPN.
The problem is that after a fresh reboot, I get the following resolv.conf:
$ cat /etc/resolv.conf
# Generated by resolvconf
domain home
nameserver ::1
options edns0
This is obviously wrong and domain name resolution is not working for lack of a nameserver.
If I go to the network-manager applet in the system tray and do “disable networking” and then “enable networking”, then the resolv.conf file is populated correctly:
$ cat /etc/resolv.conf
# Generated by resolvconf
domain home
nameserver 10.0.0.138
nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver fe80::1%enp7s0
options edns0
If, after a fresh reboot, I manually stop the NetworkManager service (systemctl stop NetworkManager.service
), then resolv.conf also gets reverted to the correct configuration above.
If I do systemctl restart network-setup.service
then resolv.conf gets reverted to the wrong configuration above, and there’s no way to fix it except again doing the “disable networking”/“enable networking” in nm-applet.
This is very annoying particularly because in some cases I just want my PC to wake up at a certain hour and run headless while I connect to it remotely. But after each boot, the network configuration is wrong.
For reference I am using a flake-enabled configuration which follows nixpkgs master.
NixOS version 22.11.20220817.3e43b5e
.
I have tried many things to address this issue and nothing works. This is very annoying as after each reboot I need to manually fix the network config.
Any ideas how to address this issue?
Thanks!