Advertisement

How to resolve address by host name in corporate network

Started by December 30, 2010 12:51 AM
0 comments, last by Bregma 13 years, 8 months ago
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!
DNS and DHCP are well-supported, widely implemented, fully documented protocols and they're already available in embedded Linux distributions everywhere. What are you looking for that is not already available?

If you intend to interact wit hother devices on a self-configuring network (one with no DNS and no DHCP) you will probably want to use one of the competing, non-interoperative de facto standards. Zeroconf/bonjour is one, UPnP is another. Apple devices use the one, Windows/HP/DLNA use the other. They both have easy-to-use support on Linux.

Stephen M. Webb
Professional Free Software Developer

This topic is closed to new replies.

Advertisement