[SOLVED] Ping ESP using hostname

teckhaokoh
Posts: 4
Joined: Wed Jun 08, 2016 3:30 pm

[SOLVED] Ping ESP using hostname

Postby teckhaokoh » Mon Aug 08, 2016 5:00 pm

Hi,

Recently I'm doing development on ESP8266, and I'm trying to get the IP address by pinging the hostname.
I set the hostname using wifi_station_set_hostname().

I'm able to get the hostname by pinging the ip address, but I couldn't get the IP address by pinging the hostname.
Anyone face the same issue before?
Any idea?

Thanks!!!

pratik

Re: Ping ESP using hostname

Postby pratik » Wed Aug 10, 2016 10:28 am

Hello,

You will have to set up mDNS or you always have the option of adding a custom DNS record to your devices. If you are pinging your ESP8266 using Windows or Linux, please look up articles online on how to add custom DNS record.
If you added
192.168.3.66 abc.xyz.mnp
Then the address abc.xyz.mnp will be resolved as 192.168.3.66 by the accessing device.

teckhaokoh
Posts: 4
Joined: Wed Jun 08, 2016 3:30 pm

Re: Ping ESP using hostname

Postby teckhaokoh » Thu Aug 11, 2016 5:07 pm

Thanks for the suggestion.
Then I guess mDNS is the best option.
Because I would like to make ESP a station connecting to a gateway, getting IP through DHCP.
This is why I prefer to use the hostname to access, so that no longer need to know the IP address, once I connected to the same network.

Thank you very much.

Who is online

Users browsing this forum: No registered users and 13 guests