Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Populating IPv6 DNS addresses in resolv.conf

145 views
Skip to first unread message

Timothy M Butterworth

unread,
Oct 30, 2023, 9:10:08 AM10/30/23
to
Hello All,

I have been following the recent emails regarding resolv.conf. I almost have my system running perfectly. The only thing I am missing is the population of IPv6 DNS addresses.

sudo less /etc/dhcp/dhclient.conf 
supersede domain-name "home.arpa";
supersede dhcp6.domain-search "home.arpa";
supersede dhcp6.name-servers 2001:4860:4860::8888, 2001:4860:4860::8844;
supersede domain-name-servers 8.8.8.8, 8.8.4.4;

sudo less /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[global-dns]
searches=home.arpa

sudo less /etc/NetworkManager/system-connections/Pixel5.nmconnection

[ipv4]
dns=8.8.4.4,8.8.8.8;
dns-search=home.arpa;
ignore-auto-dns=true 
#I tried with this on, commented out and set to false
may-fail=false
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns=2001:4860:4860::8888,2001:4860:4860::8844;
dns-search=home.arpa;
ignore-auto-dns=true 
#I tried with this on, commented out and set to false
may-fail=false
method=auto

sudo less /etc/resolv.conf
domain home.arpa
search home.arpa
nameserver 8.8.8.8
nameserver 8.8.4.4

For some reason I am not getting any IPv6 Name Servers populated.

Any thoughts are appreciated.

Tim


--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org/
⠈⠳⣄⠀⠀

Max Nikulin

unread,
Oct 30, 2023, 11:10:06 AM10/30/23
to
On 30/10/2023 20:04, Timothy M Butterworth wrote:
> sudo less /etc/resolv.conf
> domain home.arpa
> search home.arpa
> nameserver 8.8.8.8
> nameserver 8.8.4.4

I do not see "# Generated by NetworkManager" here.

nmcli connection
nmcli device
NetworkManager --print-config
ls -l /etc/resolv.conf
lsattr /etc/resolv.conf

As to /etc/dhcp/dhclient.conf and /etc/network/interfaces, I may be
wrong, but perhaps independent instances for IPv4 and IPv6 may be
running (if actual connection is managed through ifupdown)

Marco M.

unread,
Oct 30, 2023, 12:20:06 PM10/30/23
to
Am 30.10.2023 um 22:08:46 Uhr schrieb Max Nikulin:

> On 30/10/2023 20:04, Timothy M Butterworth wrote:
> > sudo less /etc/resolv.conf
> > domain home.arpa
> > search home.arpa
> > nameserver 8.8.8.8
> > nameserver 8.8.4.4
>
> I do not see "# Generated by NetworkManager" here.

That is because NM manages the file. Some users use other managers
(resolvconf, systemd-resolve) or create the file manually.
The content of the file is relevant, which software created it is
secondary.

Pocket

unread,
Oct 30, 2023, 1:20:07 PM10/30/23
to

Why not use NetworkManagers internal DHCP client.  

That is what I have done and then I don't need dhclient or dhcpcd.

I am not sure that you are really using dhclient as NetworkManager has not been set to use dhclient from the configuration that you have posted.

What is the output from:

NetworkManager --print-config

Notice in the following dhcp=internal in my configuration

NetworkManager --print-config
# NetworkManager configuration: /etc/NetworkManager/NetworkManager.conf (lib: no-mac-addr-change.conf)

[main]
# rc-manager=
# auth-polkit=true
# dhcp=internal
# iwd-config-path=
plugins=ifupdown,keyfile
configure-and-quit=no

[global-dns]
options=ends0 trust-ad

[ifupdown]
managed=false

[logging]
# backend=journal
# audit=true

[device]
# wifi.backend=wpa_supplicant
wifi.scan-rand-mac-address=no

[device-31-mac-addr-change]
match-device=driver:eagle_sdio,driver:wl
wifi.scan-rand-mac-address=no

# no-auto-default file "/var/lib/NetworkManager/no-auto-default.state"--

--

It's not easy to be me

Timothy M Butterworth

unread,
Oct 30, 2023, 3:50:06 PM10/30/23
to
On Mon, Oct 30, 2023 at 11:09 AM Max Nikulin <mani...@gmail.com> wrote:
On 30/10/2023 20:04, Timothy M Butterworth wrote:
> sudo less /etc/resolv.conf
> domain home.arpa
> search home.arpa
> nameserver 8.8.8.8
> nameserver 8.8.4.4

I do not see "# Generated by NetworkManager" here.

     nmcli connection
NAME                UUID                                  TYPE      DEVICE  
Pixel5              e70d426b-3a26-4b29-bf59-edb3dcdfdbc3  wifi      wlo1
 
     nmcli device
DEVICE  TYPE      STATE                   CONNECTION  
wlo1    wifi      connected               Pixel5     

 
     NetworkManager --print-config
sudo NetworkManager --print-config
# NetworkManager configuration: /etc/NetworkManager/NetworkManager.conf (lib: no-mac-addr-change.conf)

[main]
# rc-manager=
# auth-polkit=true
# dhcp=internal # Am I correct in thinking that this setting enables the internal DHCP client.

# iwd-config-path=
plugins=ifupdown,keyfile
configure-and-quit=no

[global-dns]
searches=home.arpa

[ifupdown]
managed=false

[logging]
# backend=journal
# audit=true

[device]
# wifi.backend=wpa_supplicant

[device-31-mac-addr-change]
match-device=driver:eagle_sdio,driver:wl
wifi.scan-rand-mac-address=no

# no-auto-default file "/var/lib/NetworkManager/no-auto-default.state"
 
     ls -l /etc/resolv.conf
     lsattr /etc/resolv.conf

I just changed this back to using chattr +i with the IPv6 addresses added.

 
As to /etc/dhcp/dhclient.conf and /etc/network/interfaces, I may be
wrong, but perhaps independent instances for IPv4 and IPv6 may be
running (if actual connection is managed through ifupdown)

Timothy M Butterworth

unread,
Oct 30, 2023, 4:00:07 PM10/30/23
to
I know it is using dhclient because I typod the domain name supersede domain-name "home.apra"; and it populated .apra in resolv.conf.
 

What is the output from:

NetworkManager --print-config

Notice in the following dhcp=internal in my configuration

NetworkManager --print-config


sudo NetworkManager --print-config
# NetworkManager configuration: /etc/NetworkManager/NetworkManager.conf (lib: no-mac-addr-change.conf)

[main]
# rc-manager=
# auth-polkit=true
# dhcp=internal
# iwd-config-path=
plugins=ifupdown,keyfile
configure-and-quit=no

[global-dns]
searches=home.arpa

[ifupdown]
managed=false

[logging]
# backend=journal
# audit=true

[device]
# wifi.backend=wpa_supplicant

Pocket

unread,
Oct 30, 2023, 5:10:05 PM10/30/23
to

^^^^^^^^^^^^^^^^^^

This states that you are running two DHCP clients as I suspected.

That is probably why you have the results you have.


From the docs page: https://networkmanager.dev/docs/api/latest/NetworkManager.conf.html


This key sets up what DHCP client NetworkManager will use. Allowed values are dhclient, dhcpcd, and internal. The dhclient and dhcpcd options require the indicated clients to be installed. The internal option uses a built-in DHCP client which is not currently as featureful as the external clients.

If this key is missing, it defaults to internal. If the chosen plugin is not available, clients are looked for in this order: dhclient, dhcpcd, internal.

The commented entries are the defaults if not explicitly set

Max Nikulin

unread,
Oct 30, 2023, 10:30:05 PM10/30/23
to
On 31/10/2023 04:02, Pocket wrote:
> On 10/30/23 15:50, Timothy M Butterworth wrote:
>>
>> I know it is using dhclient because I typod the domain name supersede
>> domain-name "home.apra"; and it populated .apra in resolv.conf.

Sorry, it is not clear for me what did you do and what result you got.
There is a script that may run ifupdown hooks:
/etc/NetworkManager/dispatcher.d/01-ifupdown
I hope, dhclient settings do not conflict with NetworkManager connection
properties.

>> /etc/NetworkManager/NetworkManager.conf (lib: no-mac-addr-change.conf)
>>
>> [main]
>> # rc-manager=
>> # auth-polkit=true
>> # dhcp=internal
> ^^^^^^^^^^^^^^^^^^
>
> This states that you are running two DHCP clients as I suspected.

I would not be so sure. Notice "[ifupdown] managed=false". It is better
to have a look into "ps axuwwf" for DHCP-related stuff (dhclient,
udhcpcd). I hope, systemd-networkd does not try to manage interfaces

networkctl

should report "unmanaged". I assume that NetworkManager uses its
internal DHCP client and it is OK.

Timothy, are you sure that "Pixel5" sends a DHCP lease? I have almost no
experience with IPv6. I would try other methods for IPv6. I hope,

nmcli connection show Pixel5

may shed more light on IPv6 configuration state. Finally, do not neglect
"journalctl -b" messages (even though I find NetworkManager log messages
rather noisy).

Max Nikulin

unread,
Oct 31, 2023, 10:30:07 PM10/31/23
to
On 30/10/2023 20:04, Timothy M Butterworth wrote:
> sudo less /etc/NetworkManager/system-connections/Pixel5.nmconnection
[...]
> [ipv6]
> addr-gen-mode=stable-privacy
> dns=2001:4860:4860::8888,2001:4860:4860::8844;
> dns-search=home.arpa;
> ignore-auto-dns=true #I tried with this on, commented out and set to false
> may-fail=false
> method=auto

I have tried to add a DNS server through GUI. The result is

[ipv6]
addr-gen-mode=stable-privacy
dns=2001:4860:4860::8888;
method=auto

Disconnect and connect again.

cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 10.0.2.3
nameserver 2001:4860:4860::8888

It is a qemu VM, it gets DHCPv4 lease, but not DHCPv6 one. I have not
tried to customize /etc/dhclient. Another data point with manually added
IPv6 DNS server is Pocket's message
https://lists.debian.org/msgid-search/94ff954f-7d28-4a86...@columbus.rr.com

Timothy M Butterworth

unread,
Nov 1, 2023, 6:50:06 AM11/1/23
to
All,

Thanks for all your help. I was able to get it mostly working:

# Generated by NetworkManager
search home.arpa
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 192.168.104.233
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844
nameserver 2600:380:bc53:b864::b3

I did not want the DNS name servers to be populated but I can live with it.

thank again for your help

Max Nikulin

unread,
Nov 1, 2023, 12:20:06 PM11/1/23
to
On 01/11/2023 17:41, Timothy M Butterworth wrote:
> All,
>
> Thanks for all your help. I was able to get it mostly working:
>
> # Generated by NetworkManager
> search home.arpa
> nameserver 8.8.8.8
> nameserver 8.8.4.4
> nameserver 192.168.104.233
> # NOTE: the libc resolver may not support more than 3 nameservers.
> # The nameservers listed below may not be recognized.
> nameserver 2001:4860:4860::8888
> nameserver 2001:4860:4860::8844
> nameserver 2600:380:bc53:b864::b3
>
> I did not want the DNS name servers to be populated but I can live with it.

Do you mean that you prefer to avoid 192.168.104.233
2600:380:bc53:b864::b3 received from DHCP?

Perhaps the 3 servers limitation may be relieved by allowing
NetworkManager to run dnsmasq.
0 new messages