I need to develop a linux device, and I want to retrieve its IP address by its host name within a corporate network (may have offices at various geographical locations). Here is my idea: I assume every corporate network shall have name server and DHCP server by default, and the linux device shall act as DHCP client. So I should be able to retrieve its IP address from the local name server. As a backup measure, I may retrieve its IP address by the device's MAC address from DHCP server. I would like to know if it makes sense to you, and if there is even better solution around. Is it possible to retrieve its IP address by its alias name as well (multiple host names to one IP address)?
I also want to support use cases when there are no name server and DHCP server available. To enable communication between a host PC and the linux device under this circumstance, I think I will need zeroconf for either multicast discovery protocol or link-plocal addressing. Is there any other solution around?
BTW, what is the easiest way to check whether the name server and DHCP server are available or not in the application software?
Thank you in advance!