# \[SOLVED\] Http Binding error exception with host name "esphome-socket14"

**URL:** <https://community.openhab.org/t/solved-http-binding-error-exception-with-host-name-esphome-socket14/152330>\
**Category:** Bindings\
**Tags:** http\
**Created:** [December 26, 2023, 1:07pm UTC](https://community.openhab.org/t/solved-http-binding-error-exception-with-host-name-esphome-socket14/152330 "2023-12-26T13:07:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ModuloFS](https://community.openhab.org/user_avatar/community.openhab.org/modulofs/32/18543_2.png) [@ModuloFS](https://community.openhab.org/u/ModuloFS)\
**Post date:** [December 26, 2023, 1:07pm UTC](https://community.openhab.org/t/solved-http-binding-error-exception-with-host-name-esphome-socket14/152330/1 "2023-12-26T13:07:36Z")

</div>

Hello,

i am using the http binding to control smart sockets flashed with esphome and a realtek RTL8710BN chip in it. (btw. this are Tecking SP22, if someone need the esphome config yaml pleas ask) Because the esphome framework does not now offer mqtt support for the realtek chip i am using http get and http post requests to control the smart plug.  
If i use the http binding an typ in the host name “esphome-socket14” for example i get the following error:  
[WARN] [p.internal.http.HttpResponseListener] - Requesting ‘[http://esphome-socket14/switch/relay\_1](http://esphome-socket14/switch/relay_1)’ (method=‘GET’, content=‘null’) failed: java.net.UnknownHostException: esphome-socket14: Name or service not known

If i am using the ip adress instead of “esphome-socket14” it works perfectly. What i am doing wrong??

Here is my configuration of the http binding:

UID: http:url:2cd1a1c6fd  
label: Teckin\_SP22\_socket11  
thingTypeUID: http:url  
configuration:  
authMode: BASIC  
ignoreSSLErrors: false  
baseURL: [http://esphome-socket14/switch/relay\_1](http://esphome-socket14/switch/relay_1)  
delay: 0  
stateMethod: GET  
refresh: 30  
commandMethod: POST  
timeout: 3000  
bufferSize: 2048  
channels:

- id: sadf  
channelTypeUID: http:string  
label: Stringding\_sp22  
description: “”  
configuration:  
mode: READONLY
- id: asfsdafdasf  
channelTypeUID: http:switch  
label: switch\_sp22  
description: “”  
configuration:  
onValue: ON  
offValue: OFF  
stateTransformation: JSONPATH:$.state

---

<div class="post-metadata">

**Author:** ![J-N-K](https://community.openhab.org/user_avatar/community.openhab.org/j-n-k/32/19276_2.png) [@J-N-K](https://community.openhab.org/u/J-N-K)\
**Post date:** [December 26, 2023, 5:38pm UTC](https://community.openhab.org/t/solved-http-binding-error-exception-with-host-name-esphome-socket14/152330/2 "2023-12-26T17:38:22Z")

</div>

It seems that java is not able to properly resolve the host-name to an IP address. Do you use a Linux-based system?

---

<div class="post-metadata">

**Author:** ![ModuloFS](https://community.openhab.org/user_avatar/community.openhab.org/modulofs/32/18543_2.png) [@ModuloFS](https://community.openhab.org/u/ModuloFS)\
**Post date:** [December 26, 2023, 6:27pm UTC](https://community.openhab.org/t/solved-http-binding-error-exception-with-host-name-esphome-socket14/152330/3 "2023-12-26T18:27:46Z")

</div>

Thank you for your fast reply. I think i found the problem. I had to add .local to the host name and it is working now. Maybe this is because of the mDNS resolution.
