Hello together.
My name is Torsten and I'm using Arduino for about one year and now the time has come, that I can't find a working solution in the internet for my problem so I'm asking you for help and first of all THANKS IN ADVANCE.
I hope I placed the post right here.
My problem:
I want to use an Arduino (Mega and UNO) in different Networks. My Problem is that if I'm setting up a static IP-Address like 192.168.1.200 the Arduino can't be found in an other network that uses e.g. 192.168.178.0/24. I'm writing Android and iOS Apps to control the Arduino but I don't want to configure the Arduino every time I change the Network.
So I decided to use DHCP from the examples "DhcpAddressPrinter" and find the arduino using the hostname. I found out, that the hostname is always WIZnetCCDE02 referring to the MAC-Address. I can see this in the tables of my DHCP-Server. But if I try to lookup the hostname using nslookup or ping it can't be resolved. So I think the hostname is only used by the dhcp server. My question is if theres a possibility to fully register the arduino in the network that the DNS-Server knows the Arduino like every other host and to change the hostname.
In addition I don't want to use UDP-Broadcasts in e.g. public networks.
You would need to register the domain name (not hostname) with your dns server. nslookup sends a resolution request to the dns server in your network settings. If that dns server doesn't know about the arduino ip/domain, it cannot resolve the domain to an ip. It needs to be a fqdn.
I know that the DNS Server don't know the Arduino. I want the Arduino to be recognized like an normal PC. And I do not have to register any computer manually in the DNS-Server to find it.
I also tried the FQDN in my company and at home but its not working too...
Your network is probably using WINS then. The DNS server would know nothing of the local hostnames without being registered with that dns server, especially localnet addresses.
But this isn't helpful for my problem because I want to give the arduino to people that do not have access to the DNS-Servers of the networks where they want to use the arduino. I want to make the arduino receive an IP and become findable via hostname in any normal home or company network that uses DHCP.
Can the hostname WIZnet... normally be found in the network?
Sleepingshorty:
Yes the will be resolved correctly.
Not on my network with my dns server. Only if I use a Windows computer on the same localnet will my Windows browser find it. nslookup on that same Windows computer will not find it. It responds with "non-existent domain".
That connection is not dhcp arranged by dns. I can connect to a Windows computer from another Windows computer using the hostname on the same localnet. If I move one of the Windows computers to a different localnet on the same router, the connection using the hostname fails.
add: The connection using the ip still works on the different localnet even tho the hostname fails.
You only find other computers on the network by name because they implement the Netbios over TCP/IP or SMB protocols.
SAMBA, which runs on *nix, for example, is an implementation of the SMB protocol. For example: even if a Linux machine has a properly assigned IP address, you can only find it by name in the network after the Samba service has started.
Arduino doesn't implement that, and it can't even scratch the surface of Netbios or SMB.
Thank you very much. Although I can't verify the statement about SMD and Netbios I found out, that my Arduino can be found in a network of a friend by it's hostname. He uses a standard FritzBox and everything was fine there so I think there is only a problem in my network.
Sleepingshortly, do you have details off the code you used to do this. I want to create a configuration page on my arduino and be able to access it in a similar way to what a Netgear router config page would be accessed by putting "routerlogin.com" into the the browser instead of using the routers IP address.