EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

How to bind host-name with an IP address

Started by Ty June 19, 2012
Hi guys,
I have a Rabbitweb server up and running. Its IP address is assign DHCP but the IP address keep changing because the router automatically release its IP address or the router reset.
Anyhow, how can I bind rabbitweb server's host-name (ex. 'wxyz') with whatever IP address its assign. My goal is to enter 'wxyz' in my browser in order to access webpages. I would really appreciate any advice. I have review some of the sample examples and I am still not sure if I understand it. Thanks again.

I created a product a few years ago that simply checked its IP address every few minutes and if it did not compare with its last IP address, it fired off an email to the administrator to alert him of the IP change. This requires loading an shtml page that echoes back the IP address of the client, then the unit just parses the returned text to extract the dotted IP info.

As for using a host name, you can give the unit its own domain name if you want. I have a unit here at my home that is set up that way. You'd just have to forward the domain to the correct IP address any time it changed. There are dynamic IP services available that can help with this, too, although I never messed with them.

For my unit, I don't use DHCP, although that is an option. I manually assigned it a local IP address on my router, then access it remotely via the IP address that is assigned to my broadband account by my ISP. This address never seems to change unless I replace the cable modem or make some other change in equipment. Of course, I had to forward port 80 to my unit using my router's settings. If you are not using a router, I guess you don't have to worry about that.

--- In r..., "Ty" wrote:
>
> Hi guys,
> I have a Rabbitweb server up and running. Its IP address is assign DHCP but the IP address keep changing because the router automatically release its IP address or the router reset.
> Anyhow, how can I bind rabbitweb server's host-name (ex. 'wxyz') with whatever IP address its assign. My goal is to enter 'wxyz' in my browser in order to access webpages. I would really appreciate any advice. I have review some of the sample examples and I am still not sure if I understand it. Thanks again.
>

Thanks for the solution of comparing current IP address to previous IP address and sending an email to client if IP Address does not match. I will have to use this solution but I was hoping for a solution that might be invisible/seamless to the client.

--- In r..., "ebrains2003" wrote:
>
> I created a product a few years ago that simply checked its IP address every few minutes and if it did not compare with its last IP address, it fired off an email to the administrator to alert him of the IP change. This requires loading an shtml page that echoes back the IP address of the client, then the unit just parses the returned text to extract the dotted IP info.
>
> As for using a host name, you can give the unit its own domain name if you want. I have a unit here at my home that is set up that way. You'd just have to forward the domain to the correct IP address any time it changed. There are dynamic IP services available that can help with this, too, although I never messed with them.
>
> For my unit, I don't use DHCP, although that is an option. I manually assigned it a local IP address on my router, then access it remotely via the IP address that is assigned to my broadband account by my ISP. This address never seems to change unless I replace the cable modem or make some other change in equipment. Of course, I had to forward port 80 to my unit using my router's settings. If you are not using a router, I guess you don't have to worry about that.
>
> --- In r..., "Ty" wrote:
> >
> > Hi guys,
> > I have a Rabbitweb server up and running. Its IP address is assign DHCP but the IP address keep changing because the router automatically release its IP address or the router reset.
> > Anyhow, how can I bind rabbitweb server's host-name (ex. 'wxyz') with whatever IP address its assign. My goal is to enter 'wxyz' in my browser in order to access webpages. I would really appreciate any advice. I have review some of the sample examples and I am still not sure if I understand it. Thanks again.
>

> I have a Rabbitweb server up and running. Its IP address is assign
>DHCP but the IP address keep changing because the router automatically
>release its IP address or the router reset.
> Anyhow, how can I bind rabbitweb server's host-name (ex. 'wxyz') with
>whatever IP address its assign. My goal is to enter 'wxyz' in my
>browser in order to access webpages. I would really appreciate any
>advice. I have review some of the sample examples and I am still not
>sure if I understand it. Thanks again.
>

You can do 2 things. Stop the DHCP client on the Rabbit once you have an address (I'm not sure how to do that but it will prevent a new addresses from being assigned). Or, when DHCP offers an address and you have one, refuse it. The bottom line is the DHCP server cannot change a client address unless the client accepts the change.

Bill

When you are dealing with routers and devices that have to be accessible remotely via the internet, it is hard to be seamless. I saw an I/O device one company made that looked pretty seamless. I believe they got around it by hard coding a lot of stuff. The product simply connected to a remote server and the users connected to the same remote server in order to access the unit.

--- In r..., "Ty" wrote:
>
> Thanks for the solution of comparing current IP address to previous IP address and sending an email to client if IP Address does not match. I will have to use this solution but I was hoping for a solution that might be invisible/seamless to the client.
>
> --- In r..., "ebrains2003" wrote:
> >
> >
> >
> > I created a product a few years ago that simply checked its IP address every few minutes and if it did not compare with its last IP address, it fired off an email to the administrator to alert him of the IP change. This requires loading an shtml page that echoes back the IP address of the client, then the unit just parses the returned text to extract the dotted IP info.
> >
> > As for using a host name, you can give the unit its own domain name if you want. I have a unit here at my home that is set up that way. You'd just have to forward the domain to the correct IP address any time it changed. There are dynamic IP services available that can help with this, too, although I never messed with them.
> >
> > For my unit, I don't use DHCP, although that is an option. I manually assigned it a local IP address on my router, then access it remotely via the IP address that is assigned to my broadband account by my ISP. This address never seems to change unless I replace the cable modem or make some other change in equipment. Of course, I had to forward port 80 to my unit using my router's settings. If you are not using a router, I guess you don't have to worry about that.
> >
> > --- In r..., "Ty" wrote:
> > >
> > > Hi guys,
> > > I have a Rabbitweb server up and running. Its IP address is assign DHCP but the IP address keep changing because the router automatically release its IP address or the router reset.
> > > Anyhow, how can I bind rabbitweb server's host-name (ex. 'wxyz') with whatever IP address its assign. My goal is to enter 'wxyz' in my browser in order to access webpages. I would really appreciate any advice. I have review some of the sample examples and I am still not sure if I understand it. Thanks again.
> > >
>

That won't work. If the router will assume that address is available and will throw it back into the "pool" and then asign it to another computer / device. Then you'll have contention - 2 devices trying to use the same address. DHCP creates a "lease" that gets renewed every x number of hours, so you can't just turn it on and get an IP address and then turn it off.

--- In r..., "BillA" wrote:
> > I have a Rabbitweb server up and running. Its IP address is assign
> >DHCP but the IP address keep changing because the router automatically
> >release its IP address or the router reset.
> > Anyhow, how can I bind rabbitweb server's host-name (ex. 'wxyz') with
> >whatever IP address its assign. My goal is to enter 'wxyz' in my
> >browser in order to access webpages. I would really appreciate any
> >advice. I have review some of the sample examples and I am still not
> >sure if I understand it. Thanks again.
> > You can do 2 things. Stop the DHCP client on the Rabbit once you have an address (I'm not sure how to do that but it will prevent a new addresses from being assigned). Or, when DHCP offers an address and you have one, refuse it. The bottom line is the DHCP server cannot change a client address unless the client accepts the change.
>
> Bill
>

Hi Ebrains2003,
The RabbitWeb server connect to a RESTful server where it dumps all its information. This is done because I was inform that some ISP block HTTP REQUEST on port 80 meaning the webpage wouldn't be accessible remotely.

The problem I have is within LAN, the rabbitweb IP address isn't necessarily static ( 1 day it might be 192.168.1.13 and another day I might be 192.168.0.12). The app that I use to connect to the rabbitweb via LAN doesn't work 100% of the time. I need a way method for the app to connect to the rabbitweb by a hostname( for ex. 'wxyz') instead of 192.168.0.13, for example. I need to tell the router that the rabbitweb is also known as 'wxyz'.
--- In r..., "ebrains2003" wrote:
>
> When you are dealing with routers and devices that have to be accessible remotely via the internet, it is hard to be seamless. I saw an I/O device one company made that looked pretty seamless. I believe they got around it by hard coding a lot of stuff. The product simply connected to a remote server and the users connected to the same remote server in order to access the unit.
>
> --- In r..., "Ty" wrote:
> >
> > Thanks for the solution of comparing current IP address to previous IP address and sending an email to client if IP Address does not match. I will have to use this solution but I was hoping for a solution that might be invisible/seamless to the client.
> >
> >
> >
> > --- In r..., "ebrains2003" wrote:
> > >
> > >
> > >
> > > I created a product a few years ago that simply checked its IP address every few minutes and if it did not compare with its last IP address, it fired off an email to the administrator to alert him of the IP change. This requires loading an shtml page that echoes back the IP address of the client, then the unit just parses the returned text to extract the dotted IP info.
> > >
> > > As for using a host name, you can give the unit its own domain name if you want. I have a unit here at my home that is set up that way. You'd just have to forward the domain to the correct IP address any time it changed. There are dynamic IP services available that can help with this, too, although I never messed with them.
> > >
> > > For my unit, I don't use DHCP, although that is an option. I manually assigned it a local IP address on my router, then access it remotely via the IP address that is assigned to my broadband account by my ISP. This address never seems to change unless I replace the cable modem or make some other change in equipment. Of course, I had to forward port 80 to my unit using my router's settings. If you are not using a router, I guess you don't have to worry about that.
> > >
> > > --- In r..., "Ty" wrote:
> > > >
> > > > Hi guys,
> > > > I have a Rabbitweb server up and running. Its IP address is assign DHCP but the IP address keep changing because the router automatically release its IP address or the router reset.
> > > > Anyhow, how can I bind rabbitweb server's host-name (ex. 'wxyz') with whatever IP address its assign. My goal is to enter 'wxyz' in my browser in order to access webpages. I would really appreciate any advice. I have review some of the sample examples and I am still not sure if I understand it. Thanks again.
> > > >
> > >
>
Configure your DHCP server so that it always assigns the same IP address to
the MAC address associated with your RabbitWeb server. That is the device
with that specific MAC address effectively gets a static IP address from the
DHCP server.

From: r... [mailto:r...] On
Behalf Of Ty
Sent: Tuesday, June 19, 2012 9:48 AM
To: r...
Subject: [rabbit-semi] Re: How to bind host-name with an IP address

Hi Ebrains2003,
The RabbitWeb server connect to a RESTful server where it dumps all its
information. This is done because I was inform that some ISP block HTTP
REQUEST on port 80 meaning the webpage wouldn't be accessible remotely.

The problem I have is within LAN, the rabbitweb IP address isn't necessarily
static ( 1 day it might be 192.168.1.13 and another day I might be
192.168.0.12). The app that I use to connect to the rabbitweb via LAN
doesn't work 100% of the time. I need a way method for the app to connect to
the rabbitweb by a hostname( for ex. 'wxyz') instead of 192.168.0.13, for
example. I need to tell the router that the rabbitweb is also known as
'wxyz'.

--- In r... ,
"ebrains2003" wrote:
>
> When you are dealing with routers and devices that have to be accessible
remotely via the internet, it is hard to be seamless. I saw an I/O device
one company made that looked pretty seamless. I believe they got around it
by hard coding a lot of stuff. The product simply connected to a remote
server and the users connected to the same remote server in order to access
the unit.
>
> --- In r...
, "Ty" wrote:
> >
> > Thanks for the solution of comparing current IP address to previous IP
address and sending an email to client if IP Address does not match. I will
have to use this solution but I was hoping for a solution that might be
invisible/seamless to the client.
> >
> >
> >
> > --- In r...
, "ebrains2003" wrote:
> > >
> > >
> > >
> > > I created a product a few years ago that simply checked its IP address
every few minutes and if it did not compare with its last IP address, it
fired off an email to the administrator to alert him of the IP change. This
requires loading an shtml page that echoes back the IP address of the
client, then the unit just parses the returned text to extract the dotted IP
info.
> > >
> > > As for using a host name, you can give the unit its own domain name if
you want. I have a unit here at my home that is set up that way. You'd just
have to forward the domain to the correct IP address any time it changed.
There are dynamic IP services available that can help with this, too,
although I never messed with them.
> > >
> > > For my unit, I don't use DHCP, although that is an option. I manually
assigned it a local IP address on my router, then access it remotely via the
IP address that is assigned to my broadband account by my ISP. This address
never seems to change unless I replace the cable modem or make some other
change in equipment. Of course, I had to forward port 80 to my unit using my
router's settings. If you are not using a router, I guess you don't have to
worry about that.
> > >
> > > --- In r...
, "Ty" wrote:
> > > >
> > > > Hi guys,
> > > > I have a Rabbitweb server up and running. Its IP address is assign
DHCP but the IP address keep changing because the router automatically
release its IP address or the router reset.
> > > > Anyhow, how can I bind rabbitweb server's host-name (ex. 'wxyz')
with whatever IP address its assign. My goal is to enter 'wxyz' in my
browser in order to access webpages. I would really appreciate any advice. I
have review some of the sample examples and I am still not sure if I
understand it. Thanks again.
> > > >
> > >
>
Not all routers have that option. More to the point, it sounds like Ty is trying to keep the end users from having to dig too deep into the technical stuff (which is tough to do with this kind of product).

These are the guys I mentioned before.

http://iobridge.com/

Their solution is about the only way I know of to make it seamless to the end user. Unfortunately, it requires a pretty complicated / expensive backend server (I guess that depends on the number of units you expect to have in the field, though).
--- In r..., "Brian Horn" wrote:
>
> Configure your DHCP server so that it always assigns the same IP address to
> the MAC address associated with your RabbitWeb server. That is the device
> with that specific MAC address effectively gets a static IP address from the
> DHCP server.
>
>
>
> From: r... [mailto:r...] On
> Behalf Of Ty
> Sent: Tuesday, June 19, 2012 9:48 AM
> To: r...
> Subject: [rabbit-semi] Re: How to bind host-name with an IP address
>
>
>
>
>
> Hi Ebrains2003,
> The RabbitWeb server connect to a RESTful server where it dumps all its
> information. This is done because I was inform that some ISP block HTTP
> REQUEST on port 80 meaning the webpage wouldn't be accessible remotely.
>
> The problem I have is within LAN, the rabbitweb IP address isn't necessarily
> static ( 1 day it might be 192.168.1.13 and another day I might be
> 192.168.0.12). The app that I use to connect to the rabbitweb via LAN
> doesn't work 100% of the time. I need a way method for the app to connect to
> the rabbitweb by a hostname( for ex. 'wxyz') instead of 192.168.0.13, for
> example. I need to tell the router that the rabbitweb is also known as
> 'wxyz'.
>
> --- In r... ,
> "ebrains2003" wrote:
> >
> > When you are dealing with routers and devices that have to be accessible
> remotely via the internet, it is hard to be seamless. I saw an I/O device
> one company made that looked pretty seamless. I believe they got around it
> by hard coding a lot of stuff. The product simply connected to a remote
> server and the users connected to the same remote server in order to access
> the unit.
> >
> > --- In r...
> , "Ty" wrote:
> > >
> > > Thanks for the solution of comparing current IP address to previous IP
> address and sending an email to client if IP Address does not match. I will
> have to use this solution but I was hoping for a solution that might be
> invisible/seamless to the client.
> > >
> > >
> > >
> > > --- In r...
> , "ebrains2003" wrote:
> > > >
> > > >
> > > >
> > > > I created a product a few years ago that simply checked its IP address
> every few minutes and if it did not compare with its last IP address, it
> fired off an email to the administrator to alert him of the IP change. This
> requires loading an shtml page that echoes back the IP address of the
> client, then the unit just parses the returned text to extract the dotted IP
> info.
> > > >
> > > > As for using a host name, you can give the unit its own domain name if
> you want. I have a unit here at my home that is set up that way. You'd just
> have to forward the domain to the correct IP address any time it changed.
> There are dynamic IP services available that can help with this, too,
> although I never messed with them.
> > > >
> > > > For my unit, I don't use DHCP, although that is an option. I manually
> assigned it a local IP address on my router, then access it remotely via the
> IP address that is assigned to my broadband account by my ISP. This address
> never seems to change unless I replace the cable modem or make some other
> change in equipment. Of course, I had to forward port 80 to my unit using my
> router's settings. If you are not using a router, I guess you don't have to
> worry about that.
> > > >
> > > > --- In r...
> , "Ty" wrote:
> > > > >
> > > > > Hi guys,
> > > > > I have a Rabbitweb server up and running. Its IP address is assign
> DHCP but the IP address keep changing because the router automatically
> release its IP address or the router reset.
> > > > > Anyhow, how can I bind rabbitweb server's host-name (ex. 'wxyz')
> with whatever IP address its assign. My goal is to enter 'wxyz' in my
> browser in order to access webpages. I would really appreciate any advice. I
> have review some of the sample examples and I am still not sure if I
> understand it. Thanks again.
> > > > >
> > > >
> > >
>

You might be able to modify the hosts file on your PC to let it know the alias. Maybe someone else can tell you how to do that. I haven't done that, so I won't try to tell you how to do it.

--- In r..., "Ty" wrote:
>
> Hi Ebrains2003,
> The RabbitWeb server connect to a RESTful server where it dumps all its information. This is done because I was inform that some ISP block HTTP REQUEST on port 80 meaning the webpage wouldn't be accessible remotely.
>
> The problem I have is within LAN, the rabbitweb IP address isn't necessarily static ( 1 day it might be 192.168.1.13 and another day I might be 192.168.0.12). The app that I use to connect to the rabbitweb via LAN doesn't work 100% of the time. I need a way method for the app to connect to the rabbitweb by a hostname( for ex. 'wxyz') instead of 192.168.0.13, for example. I need to tell the router that the rabbitweb is also known as 'wxyz'.
> --- In r..., "ebrains2003" wrote:
> >
> > When you are dealing with routers and devices that have to be accessible remotely via the internet, it is hard to be seamless. I saw an I/O device one company made that looked pretty seamless. I believe they got around it by hard coding a lot of stuff. The product simply connected to a remote server and the users connected to the same remote server in order to access the unit.
> >
> > --- In r..., "Ty" wrote:
> > >
> > > Thanks for the solution of comparing current IP address to previous IP address and sending an email to client if IP Address does not match. I will have to use this solution but I was hoping for a solution that might be invisible/seamless to the client.
> > >
> > >
> > >
> > > --- In r..., "ebrains2003" wrote:
> > > >
> > > >
> > > >
> > > > I created a product a few years ago that simply checked its IP address every few minutes and if it did not compare with its last IP address, it fired off an email to the administrator to alert him of the IP change. This requires loading an shtml page that echoes back the IP address of the client, then the unit just parses the returned text to extract the dotted IP info.
> > > >
> > > > As for using a host name, you can give the unit its own domain name if you want. I have a unit here at my home that is set up that way. You'd just have to forward the domain to the correct IP address any time it changed. There are dynamic IP services available that can help with this, too, although I never messed with them.
> > > >
> > > > For my unit, I don't use DHCP, although that is an option. I manually assigned it a local IP address on my router, then access it remotely via the IP address that is assigned to my broadband account by my ISP. This address never seems to change unless I replace the cable modem or make some other change in equipment. Of course, I had to forward port 80 to my unit using my router's settings. If you are not using a router, I guess you don't have to worry about that.
> > > >
> > > > --- In r..., "Ty" wrote:
> > > > >
> > > > > Hi guys,
> > > > > I have a Rabbitweb server up and running. Its IP address is assign DHCP but the IP address keep changing because the router automatically release its IP address or the router reset.
> > > > > Anyhow, how can I bind rabbitweb server's host-name (ex. 'wxyz') with whatever IP address its assign. My goal is to enter 'wxyz' in my browser in order to access webpages. I would really appreciate any advice. I have review some of the sample examples and I am still not sure if I understand it. Thanks again.
> > > > >
> > > >
> > >
>


The 2024 Embedded Online Conference