On 2017-08-23 22:54, James Knott wrote:
On 08/23/2017 04:45 PM, Carlos E. R. wrote:
What about a notebook computer that's been moved to a different
network? Then the address in the hosts file will likely be wrong. Ah. I have a script that adapts /etc/hosts file appropriately and automatically - postfix requires the hosts file to be correct or it fails.
Otherwise, I try to get the same IP.
If you change the name of the computer I think you also need to reconfigure postfix.
I just rely on Network Manager and have my home DHCP server configured to assign specific IP addresses to MAC addresses. This way, host name lookup works fine at home. On IPv6, addresses are automagically configured, based on prefix and MAC address and again works well with DNS.
I use NM on the laptop. My DHCP server, when used, resides on the ISP router and it does not setup the names (it can't); thus the host.domain solving does not work and postfix crashes or complains bitterly failing to post anything. On other cases the DHCP is not under my control, and of course, fails to set the correct name (or is disabled, depends). The other DHCP server resides in my Android phone (tethering) and it also fails to set up the names. Or I can be at home and then NM sets a fixed IP. But not the name. So in all cases I need to make the FQDN work and match what postfix thinks it is. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)