Debian 11, I faced issue with internet connection not available, and pinging can't resolve domain names. The
/etc/resolv.conf file is constantly overwritten by NetworkManager, and after reboot it contains
# Generated by NetworkManager nameserver ::1
resolv.conf file by adding entry
# Generated by NetworkManager nameserver 18.104.22.168
But this changes are not persistent and disappear right after reboot. I have not had this problem in the past, I believe that it appeared after using VPN and TOR browser. How to solve this issue?
EDIT: I installed
resolvconf tool, rebooted, but no changes:
~$ cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN # 127.0.0.53 is the systemd-resolved stub resolver. # run "resolvectl status" to see details about the actual nameservers. nameserver ::1
~$ resolvectl status Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.
Edit 2: there is two active network connections, one is router, and the second, seems, is from VPN service:
~$ nmcli c show TRENDnet752 | grep -i -e name_servers -e dns connection.mdns: -1 (default) ipv4.dns: 22.214.171.124 ipv4.dns-search: -- ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.ignore-auto-dns: yes ipv6.dns: -- ipv6.dns-search: -- ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.ignore-auto-dns: no IP4.DNS: 126.96.36.199 ~$ nmcli c show pvpn-ipv6leak-protection | grep -i -e name_servers -e dns connection.mdns: -1 (default) ipv4.dns: -- ipv4.dns-search: -- ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.ignore-auto-dns: no ipv6.dns: ::1 ipv6.dns-search: -- ipv6.dns-options: -- ipv6.dns-priority: -1400 ipv6.ignore-auto-dns: yes IP6.DNS: ::1
Edit 3. I managed to solve the issue use the following steps:
sudo systemctl status resolvconf.service (“Active: active (exited)” message) Opened the head file: sudo nano /etc/resolvconf/resolv.conf.d/head Entered nameservers and saved: nameserver 188.8.131.52 nameserver 184.108.40.206 Then updated resolv.conf to use the new nameservers: sudo resolvconf --enable-updates sudo resolvconf -u