1

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
5
  • 2
  • I don't think it's related to VPN or Tor. I've been having the same issue for several months on my Arch machine, and I don't use Tor and also get this both with and without VPNs being involved. NetworkManager overwrites /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.
    – terdon
    May 6 at 11:23
  • I edited my initial post, the actual record in my resolv.conf also is nameserver ::1.
    – Lexx Luxx
    May 6 at 13:43
  • Do you have a local DNS server daemon installed on your system? Like bind9 or dnsmasq or something like that? If the /run/resolvconf/interface/ directory exists, does it contain any files other than NetworkManager?
    – telcoM
    May 6 at 14:13
  • I have no bind9 or dnsmasq, but now I installed resolvconf. /run/resolvconf/interface/ directory exist, contains only "NetworkManager" file.
    – Lexx Luxx
    May 6 at 14:29

1 Answer 1

2

Since all your DNS configuration information apparently comes from NetworkManager, the next step is to investigate the NetworkManager settings.

First, use the nmcli c (c is the shorthand for "connection/s") to view the list of configured connections. If you have a colour-capable terminal, the active connections will show up in green. Note the names of the active connections.

Then, for each active connection, run:

nmcli c show <connection name here> | grep -i -e name_servers -e dns

replacing <connection name here> with the name(s) of your active connection(s) (one at a time, if you have multiple active connections). You will see all the DNS-related settings associated with each connection. The ::1 should be visible there. Settings with lower-case names should come from the NetworkManager configuration; settings with upper-case names should be generated by DHCP or some other autoconfiguration mechanism (like from the DNS resolver information optionally attached to IPv6 Router Advisory packets).

Knowing the exact name of the NetworkManager DNS setting that has the value of ::1 should help you (and also us) determine where the setting actually comes from.

In Debian, NetworkManager can get its local configuration from three places:

  • read-only from classic Debian /etc/network/interfaces
  • from files in /etc/NetworkManager/system-connections
  • from a desktop-environment-specific storage method for per-user settings.

If you find that the ::1 is specified by an autoconfiguration mechanism (you find a line that says e.g. IP6.DNS[1]: ::1), you could override that with:

nmcli c modify <connection name here> ipv6.ignore-auto-dns yes

This should make both DHCPv6 and Router Advisory-based IPv6 DNS resolver autoconfiguration ineffective on that connection. You could then configure the DNS servers of your choice with e.g.:

nmcli c modify <connection name here> +ipv4.dns 8.8.8.8

and/or

nmcli c modify <connection name here> +ipv6.dns 2001:4860:4860::8888

Alternatively, if you wish to go old-school and have NetworkManager keep its fingers away from DNS resolution settings altogether, you could add a file named /etc/NetworkManager/conf.d/DontTouchDNSResolution.conf with the following contents:

[main]
dns=none
systemd-resolved=false

After that, you can (and must) configure /etc/resolv.conf manually.

4
  • IP6.DNS[1]: ::1 so the second connection seems, belong to VPN service.
    – Lexx Luxx
    May 6 at 16:14
  • I ran three above mentioned nmcli commands, but this not helped. Still get nameserver ::1 and have to modify it manually. # 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
    – Lexx Luxx
    May 6 at 20:07
  • You mentioned a VPN. Does your system use a VPN connection (=client) or provide VPN connections to others (=a VPN server)? If a VPN client runs a local DNS resolver proxy to avoid "DNS leaks" instead of integrating with either NetworkManager or the resolvconf script utility, then changing NetworkManager or resolvconf configuration obviously won't help.
    – telcoM
    May 6 at 21:43
  • It's ProtonVPN application (client). But seems, I managed to solve the issue. I added details in the intitial topic.Thank you.
    – Lexx Luxx
    May 6 at 22:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.