On Sun, 2022-03-20 at 13:08 +0000, Patrick O'Callaghan wrote: > I think Tim's point is that the /etc/hosts file doesn't *assign* IP > addresses, it merely *records* them. Yep. In a nutshell, if you haven't manually configured your PC (or other device) to use a specific IP address, your PC gets given an IP from a DHCP server. And if it doesn't receive such instructions it may: Automatically pick a random one from the 169.254.x.y range, first trying to see if nothing else is already using that same address. It can do this entirely by itself without mDNS, Avahi, Bonjour, ZeroConf. It may just leave the network port in an offline state. Once it has an IP, it can find out the address's name by looking for entries in the hosts file, or checking with a DNS server, or a broadcast query using on of those ZeroConf protocols I just mentioned. Which essentially broadcasts a query for the desired device to identify themselves, rather like you ringing a phone number and a guy picks up and says, "Hi, George here." (Good luck on a LAN where someone has given two things the same hostname - e.g. two "my computer" PCs in a home, or two identical printers.) Some of those protocols can have a look inside their own hosts file to find the answer (if they have one). However, that's going to go wrong if the devices don't get the same IP each time. Apparently mDNS can somehow get answers from a DHCP server. I'm not sure how it'd do that from mine, my DHCP server seems limited to: * A client says it'd like to use a particular IP. * My DHCP server says yes and leases it, or says no and tells it to use another IP instead. There doesn't appear to be a mechanism to query what's Fred's IP, or who's at 192.168.1.64. And why should it, that's a DNS server's job. Again, all that would fail if the client's assumed IP wasn't entered into that database. If you want a predictable LAN, then I really only see two ways to manage that without major pain: 1. Run a DHCP server with a DNS server. That DHCP server doles out addresses, and puts those addresses into the DNS server as it doles them out, or makes use of addresses that you've already put in the DNS server (or a mix of both techniques, as I do - guests get doled out a spare address, resident devices are always assigned the same ones). 2. Manually configure each device to have a fixed IP. And if you want name resolution, hand configure each devices hosts file, or a DNS server that they all query. This can be impossible in some LANs (how do you preset an IP into your smart light bulb?) For a lot of people, there's only one device in their home LAN that other things want to make use of - their printer. Everything else is just browsing the internet independently. They're never going to know if their LAN isn't working well, and probably put all printing gremlins down to the printer just being a pain, switching things off and on until they work. -- uname -rsvp Linux 3.10.0-1160.59.1.el7.x86_64 #1 SMP Wed Feb 23 16:47:03 UTC 2022 x86_64 Boilerplate: All unexpected mail to my mailbox is automatically deleted. I will only get to see the messages that are posted to the mailing list. _______________________________________________ users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure