On Thu 03 Apr 2025 at 06:55:10 (-0400), Greg Wooledge wrote: > On Wed, Apr 02, 2025 at 22:28:24 -0500, David Wright wrote: > > 127.0.1.1 coyote.coyote.den coyote > > [...] > > I don't see the point in leaving it there. If you want to send > > something to coyote.coyote.den, why do you want the LAN address > > when 127.0.1.1 is just as good. If the line is correct, it does > > nothing; if it's incorrect, it can cause harm. > > I disagree with you here. The 127.0.1.1 address is a placeholder put > there by the installer for the more common case where a machine doesn't > have a fixed LAN IP address. Most home or workplace computers these > days will get their addresses from DHCP without a reservation, so their > internal addresses may vary.
And that means that two machines can't find each other unless the DHCP server is also a DNS server. Or you set up and run your own. > 127.0.1.1 is used when a fixed LAN IP address isn't available. But if > a fixed LAN IP address *is* assigned, that should be used instead. In one sense, my LAN has fixed addresses, fixed by assigning them through DHCP Reserved addresses. However, one of the laptops has to travel occasionally, so 127.0.1.1 makes sense here. Setting up /etc/hosts from the same script for every machine has the benefit of adding a long list of undesirable hostnames at the same time (for reducing adverts etc). > In Gene's case, where all the addressing is manually assigned and static, > using the traditional approach (192.168.x.y coyote.coyote.den coyote) > is actually preferred. It allows a single /etc/hosts file to be > copied across all computers on the LAN without needing to modify it > on each host. I'm hoping that that is indeed the case, looking back at how some hosts have moved around in previous postings. But one disadvantage of your preferred approach is that the hostname and domain won't resolve unless the network is up. I don't know whether that's why Gene installs/ed libnss-myhostname: I find the documentation rather heavy going, and would have to experiment with it a bit to make sense of it. I also don't know whether it would be at all relevant to explaining Gene's following statement: ✄✄ $ grep hosts: /etc/nsswitch.conf hosts: files mdns4_minimal [NOTFOUND=return] dns because files doesn't work in bookworm, I had to: grep hosts: /etc/nsswitch.conf hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname to make the hosts file work ✄✄ Cheers, David.