Thanks. This is kind of what I figured. I can attempt to understand why you would want to force the installation to use a static IP and /etc/hosts, but I and it seems many other users, would like better support for DHCP.
This is a topic like ... opening a can of worms. Meanwhile after your last comment, it would be tossing in some DHCP into the DNS inquiry.
You will notice a lot of tokens of "wisdom" on this forum, the likes of earlier:
being able to resolve that IP to a hostname with minimum dependencies seems natural.
Or now:
a server really needs a static IP
And even:
Proxmox is a clusterable, Enterprise-grade hypervisor.
Alas, the product name is PVE and O am not sure if it is "enterprise-grade" when one delves into the reasons, the actual reasons, the OP is seeking in this post.
You are asking the same kind of "child-like" questions as anyone curious who approached a black box and as it is open source and has an active community, rightfully so. You are getting the same kind of answers like when we asked why the sky was blue once. It's preposterous. Notice that none of the answers comes from PVE staff, they know better.
It's been over half a year since I had those same questions, over time I went through some of the code and noticed strange skeletons in the wardrobe like subroutines that are meant to obtain a remote node IP but with hackish comments of the sort "this is also used to get this node's IP", etc.
The whole PVE stack is like a pyramid and some of the pve-common parts are so ancient, it's hard to satisfactorily answer your question. With that said, it was asked so many times, it would really deserve an official FAQ section.
PVE clearly started as some MVP where lots of assumptions were made, simplicity was key, it helped streamline the early development. But then you build a lot of things on it, bugs pile on, things are harder to debug, introducing something like your casual request later is like being asked to touch a bee's nest.
Take for instance, that even if you do not use High Availability, that part of stack is always active, then there are bugs there (there's lots of self-denial and finger pointing when it comes to bugs on this forum), then if things get out of sync in an HA cluster, there will be reboots, you may basically end up completely losing the cluster if e.g. nodes would not be able to form a quorum.
Component like corosync which does not exactly run on the Perl scripts from PVE team has its own config file where hardcoded static addresses are preferred. You may wonder why, if everything was meant to be sourced from /etc/hosts, I would too. Then there is the "cluster filesystem", which is a shared database to which each node is meant to contribute, create its locks, etc. It is this part that needs to be synced amongst the nodes.
Now suppose you wanted the nodes to get DHCP assigned IPs (now if you are dreaming, you may as well dream big, imagine DHCP Option 12 support upon boot), it should not be a problem, each of your nodes should simply obtain other others' IPs from their resolver, you should be actually more stable in that there's no worries about discrepancies of /etc/hosts on different nodes.
But then you have to cater for cases when that resolver is taking its time, or you have round-robin and they get inconsistent, or two names return same IP, etc.
You will read on this forum how "corosync needs low latency" and thus PVE is not meant for geographically disparate nodes, etc. It's misrepresentation, corosync can set operate on any timeouts, but there's lots of hardcoded time limits when it comes to that e.g. cluster filesystem code because and there's no consistent helper to have those configurable (at least try to tweak them), so lots of filesystem calls could start timing out if latency gets high.
Now think of that and the potential pitfalls DNS brings into this mix (or even temporarily misconfigured/rogue DHCP on lease renew) - you would need to cater for all this so that your cluster does not fall apart into pieces. No one did, now it's like asking for lots of code review for zero additional benefit, i.e. no one would pay extra subscriptions for having this since they started on the rudimentary setup.
Let's extrapolate, next thing I would ask is for my nodes to run on IPv6 and have the cluster dependably self-heal on updated RA/RS, etc.
Basically no one is going to pay for that, also customers do not really raise change requests for the sake of refactoring (and all the associated testing which it would require) parts of stack that have not been touched for 10 years. Are you? With that said, I wish this was all more openly discussed on this forum, instead of the likes of pseudo-elitist snide remarks such as:
Just because a lot of people are using it for homelab doesn't mean the company will cater to that demographic.
No, it is really not your fault, you asked something very logical, the answer is a bit embarrassing to admit and there's no business case because it's really not that enterprise grade. It is really good considering how small the dev team is, also consider there's no proper governance board, etc. I wish not to be mean, some of the aboveI learned from PVE staff on the forum themselves willing to openly share, but what I will never understand why there's this over-protectionism against who knows which market forces (certainly not Broadcom lately) when (not) addressing these uncomfortable FAQs.
Oh, and anyone who really knows the code well, feel free to correct me wherever I was wrong myself.