[Samba] DNS issue with clean install of samba 4.5.12-Debian

Rowland Penny rpenny at samba.org
Fri Dec 15 10:02:32 UTC 2017

On Fri, 15 Dec 2017 09:58:03 +0100
"L.P.H. van Belle via samba" <samba at lists.samba.org> wrote:

> Hai Mike, 
> I post it to the list so everybody can learn from it. 
> > Why you use "hostname -i" ?
> man hostname wil tell.. But i'll try to explain it a bit. 
> Read the Description, its also about how the hostnames are resolved
> within the systemfuntions. Like gethostname and gethostbyname 
> > root at ad51:~# hostname -i
> >
> > root at ad51:~# hostname -I
> > 
> Hostname -i , works only if the hostname can be resolved. 
> Hostname -I , Displays all network addresses of the host. ( but not
> ) Now remembering that. 
> Imo, hostname -i and hostname -I should imo not resolve to
> localhost/ If thats the case then your resolving might
> be faulty. 
> What is localhost. 
> localhost =
> localhost = ::1 
> Localhost.localdomain =

There is no such thing as 'localdomain', this is something that
somebody came up with, my suggestion is to not use it.

> ip6-localhost ip6-loopback = ::1 
> Last, but this one should be in the DNS zone. 
> localhost.primary.domain.tld =

No it shouldn't. localhost has its own zone, as does
(reverse), see /etc/bind/named.conf.default-zones

> The following. 
> /etc/hostname contains name of the machine, as known to applications
> that run locally. 
> /etc/hosts and DNS associate names with IP?addresses. 
> And myname may be mapped to whichever IP?address the machine can
> access itself, but mapping it to is unæsthetic.
> Not /etc/hosts, but /bin/hostname serves another function with -f
> because /etc/hosts can override the common sense. 

/etc/hosts is the old way of doing things (and I mean really old), all
that should be in /etc/hosts is and the computers ipaddress
and what they point to, anything else should be found from dns.

> Now per example. 
> A good /etc/hosts = (empty)  but then you must have a dns server
> running. A minimal /etc/hosts only has :
>       localhost
> ::1		    localhost ip6-localhost ip6-loopback
> And as extra with dhcp (optional) 
>       hostname hostname.localdomain 

Nope, this just causes problems, if you have '' in /etc/hosts,
I would remove it.

> Or 
>       localhost hostname hostname.localdomain ( not
> recommended ) 

As in don't use it ;-)

> Or bit more. 
>		computername.internal.domain.tld
>		computername.domain.tld
> Basicly any FQDN must be resolvable where it is used.

True, but it should just be the computers own info.

> Now a practical use, like a webserver. 
> Lets say you have this in /etc/hosts 
>       localhost
> ::1		    localhost ip6-localhost ip6-loopback
>		computername.internal.domain.tld
>		computername.domain.tld

Ah, now this is different, here you are associating another IP with the
computers FQDN, but wouldn't you be better doing this with a CNAME ?


More information about the samba mailing list