I have a device that needs to communicate with a Windows machine hosting mysql. They are both on a wired network that uses DHCP with no possibility of getting static IPs.
WINS (resolving by machine name) works fine from a normal browser but the Arduino can't resolve it when I just put it in has the hostname. It works fine if I hardcode the current IP but then I need to update it whenever the Windows machine gets a new IP. The lease times here seem to be very short, I get a new IP every time I log in.
Does anybody know of any other options?
Here's part of the code I'm using
if(client.connect(HOST_NAME, HTTP_PORT)) {
client.println(HTTP_METHOD + " " + PATH_NAME + queryString + " HTTP/1.1");
client.println("Host: " + String(HOST_NAME));