Can ethernet shield use WINS?

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. :frowning:

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));

WINS is a rather ancient proprietary protocol used by Microsoft only. I'm not aware of an implementation for the Arduino platform. But if you use a rather current OS you may use mDNS to resolve a hostname in your network. You cannot use the hostname directly as the mDNS resolver isn't part of the standard libraries, but you can use a library to resolve a service name to an IP and use that in the basic libraries.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.