Web-server – registering hostname using DHCP

dhcpdomain-name-systemembeddedhostnameweb-server

I am working on the development of a network device. When it boots up, I want it to register a domain name on the network so that a customer can easily browse to the webserver interface. Eg. http://device-name

I tried including the hostname in DHCP Option 12 and again in Option 81. I can see the hostname appearing in the DHCP clients table but not able to access the webserver using the hostname. Using the IP address of the device works fine. Similarly for pinging too…

There are 2 scenarios in which I want this to work.

  1. When the device is connected to a local network which is in turn connected to the Internet.
  2. Only the device and a Windows PC are connected using a Linksys router.

In both cases, nslookup doesn't yield any result. 🙁
I get the error 'non-existent domain'.

Is there any workaround for this?

Since its a end-user device, I have to confine changes, if any, to the DHCP client as much as possible.
Please feel free to ask for any clarifications. Thank you so much.

Best Answer

You generally need server-side support for this; tools like dnsmasq can do it out of the box.

Alternatively, consider using multicast DNS/Rendezjour or UPnP for service discovery and hostname lookup.