I discovered in the autogenerated zone files from recent SAMBA 4 versions the ip address set to "127.0.0.1" rather than the one visible in the network. I've to change it after every provision process.
Could it be that this is caused by a missing "/etc/hosts" line/entry?
Use the --host-ip option if your hostname does not resolve to a public IP address.
*** Bug 7142 has been marked as a duplicate of this bug. ***
Andrew Bartlett asked me to file a new bug report. I did as requested - 7142 is the result.
- John T.
We can at least impose a filter to avoid any 127.* address being loaded into the zone file, if not specified.
We can also try a reverse lookup on all the addresses found by the interfaces code and see if any of those match the proposed host name. (Which should distinguish between VPN, virtual and other interfaces).
Sorry, JHT for closing the new bug report - but it's always the same issue. Let us now track the problem here in the original report.
I changed also the title to be more expressive.
I pushed a patch which uses always a non-127.0.0.x address of the "/etc/hosts" file if other addresses are available (and the same also for IPv6 - "::1" is the local loopback there).
If you (jht) are satisfied with this approach please close.
I don't think this will be quite enough to defeat the silly /etc/hosts produced by the OpenSUSE install on the box JHT has.
Tridge has recently added a get_interfaces hook in python in some of his soon to land work on DNS. When that lands we should be able to do the proposed reverse name resolution trick. We should also be able to look for the only non-loopback address in some other cases.
This may also be overtaken by us simply always using dynamic DNS updates.
> Tridge has recently added a get_interfaces hook in python in some of his soon
> to land work on DNS. When that lands we should be able to do the proposed
> reverse name resolution trick. We should also be able to look for the only
> non-loopback address in some other cases.
yep, that is the right fix. We should use glue.interface_ips() in the provision.
That will avoid loopback, and ensure the IPs we get matches what Samba will
actually listen on.
I will shortly push a fix. Marking this as "FIXED".