Hostname of ESP?
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 30
- Joined: 10 Dec 2016, 20:09
Hostname of ESP?
Hi everyone, i would like to know if it exists any way to reach a esp with espeasy software by http protocol with a hostname instead of ip.
Currently i need to hit the following url http://someip/ to get the web configuration page. But i would like to try to reach http://hostname/ to avoid an issue if the esp changes its ip
I already try to reach http://name_of_esp without results.
Of course i could defined a fixed ip but if another computer try this ip on a network , none of them could be reach due to network problem.
Thank you.
Currently i need to hit the following url http://someip/ to get the web configuration page. But i would like to try to reach http://hostname/ to avoid an issue if the esp changes its ip
I already try to reach http://name_of_esp without results.
Of course i could defined a fixed ip but if another computer try this ip on a network , none of them could be reach due to network problem.
Thank you.
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: Hostname of ESP?
Not a problem to connect to host name. What is your ESP Easy version?
I run 2.0.0 (dev12)
I run 2.0.0 (dev12)
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



-
- Normal user
- Posts: 241
- Joined: 21 Mar 2017, 17:35
Re: Hostname of ESP?
Host name is unit name '-' unit number!
Eg.
unit name = ESP01
unit # = 1
Host name: ESP01-1
Eg.
unit name = ESP01
unit # = 1
Host name: ESP01-1
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: Hostname of ESP?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



-
- Normal user
- Posts: 30
- Joined: 10 Dec 2016, 20:09
Re: Hostname of ESP?
My name is ESP and the unit number is 1 the version of ESP easy is dev12 (v2.0.0-dev12)
When i type in firefox or internet explorer
http://ESP_1 (or http://ESP-1)
No configuration page is provided (in the case of firefox, it forward to http://www.esp_1.com/ (i guess it tries to adapt the request).
I'm using Windows 10 64 bits
When i type in firefox or internet explorer
http://ESP_1 (or http://ESP-1)
No configuration page is provided (in the case of firefox, it forward to http://www.esp_1.com/ (i guess it tries to adapt the request).
I'm using Windows 10 64 bits
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Hostname of ESP?
Yes, that is possible but it comes with some work.
At first, this is not a problem of ESPEasy.
If you look into the network interface config of your computer you will notice a setting "DNS" possibly together with an IP address.
DNS (the "Domain Name Service") is the service who translates a domain name "www.whatever.xyz" into an IP address for you.
Every country has an authority that allocates an IP to your comain name. They run the main DNS server of the "Top Level Domain".
Top Level Domains are the third part of the domain name, for example .com, .de, .net, .org and so on. The DNS server of your provider
is a sub-server of this main server. If your router has it's own DNS server, this is s subserver of your providers DNS server.
So if you enter "www.abc.xyz" at your browser, your browser asks the DNS configured in your settings for the IP. That DNS may know
the IP address already. If not, he will ask the server of your provider and so on.
So everything depends on what is configured in your home network. If you use an external DNS from your provider, or the "8.8.8.8"
DNS from Google, name resolution is not possible as your home isn't an official domain registered by your countries domain authority.
Usually it is not even possible to get an official IP for your home domain as you will use the 192.168.x.y or other non-routing addresses
like 172.16.x.y or 10.x.y.z. These addresses are for internal use and will not be routed through the net.
If your router provides an internal DNS and your computer is configured to use that DNS instead of an external one, you may check your
router configuration if it is possible to set internal addresses and names. If your router is really good it might be able to handle this
even automatically.
There is a third way: Use a small computer, an Raspberry Pi for example and leave the automatic IP adress configuration (DHCP)
and DNS to this one, deactivating all these services in your router.
But be warned: Setting up a full DNS/DHCP with dynamic DNS configuration is definitely not trivial. This way gives a lot of possibilities
a usual home router can't give but many possibilities on the other hand always says many possibilities to go wrong. It needs some
knowledge about IP itself, the BIND DNS server, ISC DHCP and generating encryption certificates to configure that.
Regards
Shardan
At first, this is not a problem of ESPEasy.
If you look into the network interface config of your computer you will notice a setting "DNS" possibly together with an IP address.
DNS (the "Domain Name Service") is the service who translates a domain name "www.whatever.xyz" into an IP address for you.
Every country has an authority that allocates an IP to your comain name. They run the main DNS server of the "Top Level Domain".
Top Level Domains are the third part of the domain name, for example .com, .de, .net, .org and so on. The DNS server of your provider
is a sub-server of this main server. If your router has it's own DNS server, this is s subserver of your providers DNS server.
So if you enter "www.abc.xyz" at your browser, your browser asks the DNS configured in your settings for the IP. That DNS may know
the IP address already. If not, he will ask the server of your provider and so on.
So everything depends on what is configured in your home network. If you use an external DNS from your provider, or the "8.8.8.8"
DNS from Google, name resolution is not possible as your home isn't an official domain registered by your countries domain authority.
Usually it is not even possible to get an official IP for your home domain as you will use the 192.168.x.y or other non-routing addresses
like 172.16.x.y or 10.x.y.z. These addresses are for internal use and will not be routed through the net.
If your router provides an internal DNS and your computer is configured to use that DNS instead of an external one, you may check your
router configuration if it is possible to set internal addresses and names. If your router is really good it might be able to handle this
even automatically.
There is a third way: Use a small computer, an Raspberry Pi for example and leave the automatic IP adress configuration (DHCP)
and DNS to this one, deactivating all these services in your router.
But be warned: Setting up a full DNS/DHCP with dynamic DNS configuration is definitely not trivial. This way gives a lot of possibilities
a usual home router can't give but many possibilities on the other hand always says many possibilities to go wrong. It needs some
knowledge about IP itself, the BIND DNS server, ISC DHCP and generating encryption certificates to configure that.
Regards
Shardan
Regards
Shardan
Shardan
-
- Normal user
- Posts: 241
- Joined: 21 Mar 2017, 17:35
Re: Hostname of ESP?
Can you ping the device from your windows system?
ping esp_1 (or http://esp_1)
What is the answer?
ping esp_1 (or http://esp_1)
What is the answer?
-
- Normal user
- Posts: 241
- Joined: 21 Mar 2017, 17:35
Re: Hostname of ESP?
@grovkillen: What you mean is SSID. That is with "_". But SSID is not host name.
See source code:
SSID:
String ssid(Settings.Name);
ssid+=F("_");
ssid+=Settings.Unit;
return (ssid);
Host name:
String hostname(WifiGetAPssid());
hostname.replace(F(" "), F("-"));
return (hostname);
See source code:
SSID:
String ssid(Settings.Name);
ssid+=F("_");
ssid+=Settings.Unit;
return (ssid);
Host name:
String hostname(WifiGetAPssid());
hostname.replace(F(" "), F("-"));
return (hostname);
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: Hostname of ESP?
Weird, I connect to my units using the hostname with "_" as separator...?vader wrote: ↑27 Dec 2017, 20:24 @grovkillen: What you mean is SSID. That is with "_". But SSID is not host name.
See source code:
SSID:
String ssid(Settings.Name);
ssid+=F("_");
ssid+=Settings.Unit;
return (ssid);
Host name:
String hostname(WifiGetAPssid());
hostname.replace(F(" "), F("-"));
return (hostname);
EDIT: aaaah, any spaces are replaced with "-"! The separator between name and number is still "_".
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Hostname of ESP?
In this case your router has a DHCP service running that gives your devices an IP address.
Check router configuration, it should be possible to limit the address range.
For example if your router works in a network of 192.168.1.xxx limit the range from 192.168.1.50 to 192.168.1.150.
All Adresses from 192.168.1.151 to 192.168.1.254 can be used for devices with fixed IP without running into address collisions,
Regards
Shardan
Regards
Shardan
Shardan
-
- Normal user
- Posts: 241
- Joined: 21 Mar 2017, 17:35
Re: Hostname of ESP?
@grovkillen: Sure? I have made a test with a fresh installation (2.0.0-dev12). Only AP configured! And see what Linux means to the host name: 

You do not have the required permissions to view the files attached to this post.
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: Hostname of ESP?
Have you tried "esp-easy_0"?
Mine work:
Mine work:
You do not have the required permissions to view the files attached to this post.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Hostname of ESP?
The fritz.box uses a DHCP which feeds the name automatically to DNS (so called "Dynamic DNS"). You may notice from the name "<name>.fritz.box"
So if you enter a "Ping <hostname>" the DNS inside the Fritz.Box automatically resolves the given URL to the IP address.
Obviously the router of the thread opener can't do dynamic DNS or it is not configured.
Regards
Shardan
Shardan
-
- Normal user
- Posts: 30
- Joined: 10 Dec 2016, 20:09
Re: Hostname of ESP?
pinging host name is unknow.
For the recommandation of the DHCP list between 1 and 150, i is ok but if someone add the same ip of ESP, it could happen a network conflict and in this case none of the devices are reachable.
On my side i have an old router Cisco
For the recommandation of the DHCP list between 1 and 150, i is ok but if someone add the same ip of ESP, it could happen a network conflict and in this case none of the devices are reachable.
On my side i have an old router Cisco
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: Hostname of ESP?
"Hostname unknown" says that the name can't be resolved to an IP address by the DNS you use.
Take a look at my first post in this thread, this is solveable, but it needs some work.
The DHCP server gives addresses between 1..150. If you assign adresses manually from 151 upwards a collision is unlikely. Or are several people giving addresses to ESPs? That might indeed run into problems.
I can't say much about cisco routers, i don't know them.
Regards
Shardan
Regards
Shardan
Shardan
Who is online
Users browsing this forum: Ahrefs [Bot], Anthropic Claude Bot [bot], Google [Bot] and 21 guests