Connect to a webserver

Hi

I am planning on using a webserver to do device configuration on a G120 with ENC28J60.

The device will always get its ip address from a DHCP server and the ip address assigned by the DHCP server is not visible to the user, so it’s not possible to this ip address to connect to the webserver.

Question 1:
It is possible set a secondary static ip address for example 169.254.2.50 that can be used to connect to the webserver.

Question 2:
How do you set a DNS name and using it to connect to the webserver.

for question 1, you could have the unit periodically broadcast its address using udp broadcast.

…and if you format those as UPnP announcements, you might even be able to get your device to show up in Windows Explorer. Double clicking on it will open your web configuration page. This requires that you send UPnP NOTIFY packets and respond to web requests for a static XML document that describes your endpoint.

1 Like

Use your DHCP server and setup a reservation for and IP tied to the MAC address. That way your device will always have the same address. Then add an entry in Your DNS that will translate the name to IP.

This can usually be done in the router which is attached to your cable/fios service.

I don’t think many home routers can act as a DNS server.

you are correct. I was elaborating on the dhcp portion.

If you don’t have a local DNS server you can manually edit the “host” file on each machine and add the entry. Works for desktops not sure about phones and tablets. I just goggled android and the host file lives in /etc, not surprising.