[Samba] NetworkManager,?==?utf-8?q? DNS, and resolv.conf

Jürgen Echter j.echter at echter-kuechen-elektro.de
Tue Mar 8 07:02:25 UTC 2022

Am Samstag, März 05, 2022 15:42 CET, schrieb Patrick Goetz via samba <samba at lists.samba.org>:
I think the following pertains to all desktop clients configured with
NetworkManager, but this particular machine is configures with Ubuntu
20.04 Mate edition.

I've been following the Samba Wiki instructions for setting up a domain
member, in particular the /etc/resolv.conf configuration:


So, on a machine called erap-ubuntu I had configured /etc/resolv.conf
like this:

search ea.linuxcs.com

This morning I was testing something and noticed that /etc/resolv.conf
had been rewritten by NetworkManager:

search linuxcs.com

I don't typically use NetworkManager, so this was residual from the
initial install. Doing a little testing, when you edit /etc/resolv.conf
by hand, NetworkManager doesn't know about this and instead defers to a
NetworkManager-specific configuration file:

/etc/NetworkManager/system-connections/Wired connection 1.nmconnection

My bind nameserver, was set in this file, but NetworkManager
still defers to the systemd-resolved nameserver stub,

Any time NetworkManager is restarted, /etc/resolv.conf is reset to use even if I explicitly set the samba-dc nameserver in the
NetworkManager configuration for that interface. The search domain is

Given the prevalence of NetworkManager, this is one of those "if you
can't beat them, join them" situations, so I experimented with just
leaving /etc/resolv.conf set to:

search ea.linuxcs.com

and everything seems to work fine:

root at erap-ubuntu:~# wbinfo -i mduffy

root at erap-ubuntu:~# samba-tool dns query samba-dc
1.168.192.in-addr.arpa 85 PTR -U Administrator
Password for [EA\Administrator]:
Name=, Records=1, Children=0
PTR: erap-ubuntu.ea.linuxcs.com (flags=f0, serial=5, ttl=900)

root at erap-ubuntu:~# host -t SRV _ldap._tcp.ea.linuxcs.com
_ ldap._tcp.ea.linuxcs.com has SRV record 0 100 389

So unless there's something I'm overlooking, I'm going to update the
Wiki so that the vast majority of linux users (i.e. all those folks
using NetworkManager) aren't confused by this.

To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/sambaHi,

for me it worked when i disabled auto-dns and set the search domain and dns server manually like this:

nmcli con mod enp1s0 ipv4.ignore-auto-dns yes
nmcli con mod enp1s0 ipv4.dns ""
nmcli con mod enp1s0 ipv4.dns-search "samdom" 

More information about the samba mailing list