# Http request node does not work with Hostname only IP

**URL:** https://discourse.nodered.org/t/http-request-node-does-not-work-with-hostname-only-ip/49612
**Category:** General
**Created:** [11 August 2021 12:10 UTC](https://discourse.nodered.org/t/http-request-node-does-not-work-with-hostname-only-ip/49612 "2021-08-11T12:10:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![novski](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/novski/32/23243_2.png) [@novski](https://discourse.nodered.org/u/novski)
#### Post date: [11 August 2021 12:10 UTC](https://discourse.nodered.org/t/http-request-node-does-not-work-with-hostname-only-ip/49612/1 "2021-08-11T12:10:45Z")

</div>

i have a simple GET request node setup to reqest the status of a lamp.  
If i trigger it with a hostname that i can reach with any browser it does not work.  
As soon as i put the IP of that device instead, it works.

this is the simple flow:  
`[{"id":"431ec79c.efa0f","type":"http request","z":"ecf5db33.a01038","name":"digitalswitch GET","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://my-device.local:8888/1/properties/switch","tls":"","persist":false,"proxy":"","authType":"basic","credentials":{},"x":970,"y":640,"wires":[["11d1a488.390d03","38ef20d5.5fd8f"]]},{"id":"5a48f3bf.5b5b0c","type":"inject","z":"ecf5db33.a01038","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"2","topic":"","payload":"true","payloadType":"bool","x":780,"y":640,"wires":[["431ec79c.efa0f"]]},{"id":"38ef20d5.5fd8f","type":"debug","z":"ecf5db33.a01038","name":"get","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1170,"y":640,"wires":[]}]`

Is it normal that hostnames do not get resolved?

---

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [11 August 2021 12:32 UTC](https://discourse.nodered.org/t/http-request-node-does-not-work-with-hostname-only-ip/49612/2 "2021-08-11T12:32:52Z")

</div>

This will depend on what OS you are running Node-RED on and how it's configured.

`.local` addresses are resolved using mDNS and traditionally Windows does not support resolve mDNS addresses.

Also If you are running in Docker then it won't be able to resolve mDNS addreses either as the container doesn't have direct access to the local network to do the multicast request.

---

<div class="post-metadata">

### Author: ![novski](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/novski/32/23243_2.png) [@novski](https://discourse.nodered.org/u/novski)
#### Post date: [12 August 2021 04:35 UTC](https://discourse.nodered.org/t/http-request-node-does-not-work-with-hostname-only-ip/49612/3 "2021-08-12T04:35:34Z")

</div>

I have it on a Linux VM and docker running inside it, in [`host_mode`](https://stackoverflow.com/a/58121028/4061870). So I think Docker should not be the problem here, as `host_mode` makes networks transparent to the host. LVM could be the problem but, I have the Docker host\_mode active because of the `node-red-contrib-homekit` package that needs the mDNS as well, and works since I enabled the `host_mode`.  
I don't exactly know how it is done with my iot-power-switches from '[mystrom](https://github.com/myStrom/node-red-contrib-mystrom)' but they get discovered very well.  
 ![Bildschirmfoto 2021-08-12 um 06.26.07](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/9/99bd3a6fc8dc8d5dea84dfa0ec25abcfe1f6b343.png)  
Do you know about a test scenario I can go through, to verify that mDNS blocking is responsible for not working `.local` hostnames?

---

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [12 August 2021 08:49 UTC](https://discourse.nodered.org/t/http-request-node-does-not-work-with-hostname-only-ip/49612/4 "2021-08-12T08:49:59Z")

</div>

The node will be doing it's own mDNS discovery to find those devices, where as the HTTP-Request node is just using the normal OS DNS lookup to find the IP address of the hostname you entered.

Docker containers are not setup to do mDNS resolution via this path (it needs edits to the `/etc/nsswitch.conf` file and avahi installing).

The easier option might be to run a DNS-to-mDNS proxy on the host machine (e.g. [GitHub - hardillb/dns-to-mdns: Bridging normal DNS to mDNS](https://github.com/hardillb/dns-to-mdns) that I wrote a while ago for just this sort of problem). You will then need to change the settings on the container to point it to this DNS server. ([Container networking | Docker Documentation](https://docs.docker.com/config/containers/container-networking/#dns-services))

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [11 October 2021 08:50 UTC](https://discourse.nodered.org/t/http-request-node-does-not-work-with-hostname-only-ip/49612/5 "2021-10-11T08:50:04Z")

</div>

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