[Samba] linux client DNS issues

L. van Belle belle at samba.org
Tue Feb 8 09:24:29 UTC 2022


 

> I checked /etc/hostname and it only has the short hostname in it, I
> then checked /etc/hosts and it had three lines:
> 
> 127.0.0.1 localhost
> ::1 localhost
> 127.0.1.1 archmem.samdom.example.com archmem
> 
> As a test I commented out the last line, left the domain and then
> rejoined the domain, this time it worked without the DNS error.
> 
Then this worked after marking out the line : 127.0.1.1
archmem.samdom.example.com archmem 
Is due to the resolving order. By removing it you enfored it question the
DNS on it. 

As most distro's use 127.0.1.1 to define the "localhost" by "hostname" 
when you used DHCP IP at install. 

IP address 127.0.1.1 is registered as a loopback interface address, *( RFC
6890 )
Nothing wrong with it. 
But I think we can easy improve samba here, because in my opinion, samba
picks the wrong ip. 
It should have pickup any 127.0.0/8 adres, these are already IN the dns by
RFC. 
(* like localhost.samdom.example.com) 

I see it like this. 

- server gets installed with DHCP. 
	host files has correct entries, but it missing one. ( not really )..

The ip 127.0.1.1 is only use in local resolving, no (remote) client gets
this one. 
But the samba script picks it up. 

If you run hostname -I *( compaired to hostname -i) you do get the right ip.

Only now its missing the /etc/hosts entry, which is not really needed,
if the IP is already in the DNS database.

If samba at provisioning can detect the ip : 127.0.1.1 and when thats the
case. 
It knows its installed by dhcp and should run : hostname -I *( for example )

Then at provisioning, the "DNS database" holds the correct IP and hostname. 

The "correct" hostname (in my opinion).. 

Should look like this. 
> 127.0.0.1 localhost
> ::1 localhost

> 127.0.1.1 archmem.localdomain

The FQDN registation is in the dns. 
So why do we need   IP FQ.DN SN in the /etc/hosts. 
Only because, what if DNS failes to resolve.. 

Just my thinking on this. 

Greetz, 

Louis








More information about the samba mailing list