EmbeddedRelated.com
Forums

How to bind host-name with an IP address

Started by Ty June 19, 2012
--- In r..., Tom Collins wrote:
>
> On Jun 20, 2012, at 7:13 AM, Phil D wrote:
> > Why not boot in DHCP first time and then change the set-up to static ip configuration once happy with IP assume once the device is installed it will remain there.
> >
> When a DHCP server issues an address, it has a timed lease. At the end of that time, if the device has not renewed the lease, the address goes back into the address pool and can be assigned to another device.
>
> Most DHCP servers can be configured to associate an IP address with a fixed MAC address so your rabbit would always get the same IP.
>
> > I to would like to implement a host name setup will have to look into how windows achieves this.
>
> Take a look at http://rabbitlib.sourceforge.net/ -- it includes support for the Windows NetBIOS protocol, which I assume includes NBNS name resolution. Machines on your local network would be able to use a fixed hostname in the web browser to connect to the Rabbit. I haven't used that version myself, and I also have a copy of another implementation that an engineer from Argentina sent me 3 years ago.
>
> If you want to allow connections from across the Internet, it's necessary to configure your router/firewall to forward connections on the public IP address to your internal Rabbit. The Rabbit may need to learn its public IP address (I think recent DC 10 releases have an HTTP client sample that does that) if it includes that IP in any of the web pages it generates (like a page redirect).
>
> Recent DC 10 releases also have a sample (dyndns.c) that connects to dyndns.org and updates a hostname for any given IP. You can have the Rabbit check its address periodically, and then send an update request to dyndns.org if the address has changed.
>
> -Tom
>
Thanks Tom, I like your solution along with Scott @ shdesigns2003. The end-user/client doesn't get involve.