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
I edited resolv.conf
file by adding entry
# Generated by NetworkManager
nameserver 8.8.8.8
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: 8.8.8.8
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[1]: 8.8.8.8
~$ 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]: ::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 8.8.8.8
nameserver 8.8.4.4
Then updated resolv.conf to use the new nameservers:
sudo resolvconf --enable-updates
sudo resolvconf -u
/etc/resolv.conf
but I haven't taken the time to figure out how/why it puts::1
(not:::.1
, in my case) instead of an actual IP. In my case, this happens whenever I connect to a new network/switch networks.nameserver ::1
.bind9
ordnsmasq
or something like that? If the/run/resolvconf/interface/
directory exists, does it contain any files other thanNetworkManager
?resolvconf
./run/resolvconf/interface/
directory exist, contains only "NetworkManager" file.