How to resolve address by host name in corporate network

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!

Reply to
Like2Learn
Loading thread data ...

Domain Name Server (DNS).

Reply to
linnix

Do a google search. *Someone* has asked this very same question REPEATEDLY, here...

Reply to
D Yuniskis

Le 30/12/2010 07:54, Like2Learn a écrit :

Several DNS by default ?? Are speaking about DNS admin ? More likely i think you have already DNS of your Internet Service Provider. Also i think you should stay and learn about WAN/LAN IP address. WAN IP Adresses have permission to be routed over the Internet unlike LAN IP Adress could not. You should also learn about NIS services because i think these are more suitable for things you are speaking about (did i understand ?).

No matter about backup measure.

shell retrieves DNS infos in /etc/resolv.conf (depends on your Linux dist) in C i think there are several "monkey recipies" to do that, may be you should read the TCP/IP socket API

HBV

Reply to
Habib Bouaziz-Viallet

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.