# Node-Red DNS Resolution

**URL:** https://discourse.nodered.org/t/node-red-dns-resolution/51781
**Category:** General
**Created:** [2 October 2021 15:07 UTC](https://discourse.nodered.org/t/node-red-dns-resolution/51781 "2021-10-02T15:07:00Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![chrismo16](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chrismo16/32/31205_2.png) [@chrismo16](https://discourse.nodered.org/u/chrismo16)
#### Post date: [2 October 2021 15:07 UTC](https://discourse.nodered.org/t/node-red-dns-resolution/51781/1 "2021-10-02T15:07:00Z")

</div>

I have NR running as an addon in HomeAssistant. I have a msg.payload.url that only works when I use the ip address instead of the hostname. How can I make sure NR is using my internal dns servers? I read elsewhere that adding network\_mode: "host" to docker-compose.yaml file solved it for someone else but I do not believe there is a docker compose file when running as an addon for HA or is there?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [2 October 2021 16:47 UTC](https://discourse.nodered.org/t/node-red-dns-resolution/51781/2 "2021-10-02T16:47:00Z")

</div>

Can you access the domain name from that machine using something outside node red? Ping for example.

---

<div class="post-metadata">

### Author: ![chrismo16](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chrismo16/32/31205_2.png) [@chrismo16](https://discourse.nodered.org/u/chrismo16)
#### Post date: [2 October 2021 16:53 UTC](https://discourse.nodered.org/t/node-red-dns-resolution/51781/3 "2021-10-02T16:53:28Z")

</div>

Yes, I can. It is actually the homeassistant host itself. I'm hosting an mp3 at an endpoint.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [2 October 2021 17:32 UTC](https://discourse.nodered.org/t/node-red-dns-resolution/51781/4 "2021-10-02T17:32:59Z")

</div>

You may need to ask in the HA forum as it's more a configuration on their side of things rather than anything Node-RED does.

---

<div class="post-metadata">

### Author: ![chrismo16](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chrismo16/32/31205_2.png) [@chrismo16](https://discourse.nodered.org/u/chrismo16)
#### Post date: [2 October 2021 18:26 UTC](https://discourse.nodered.org/t/node-red-dns-resolution/51781/5 "2021-10-02T18:26:32Z")

</div>

OK, I'll give that a try. Since I was able to ssh into HA and it is able to resolve the hostname, I thought this would be a NR issue.

---

<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: [2 October 2021 18:28 UTC](https://discourse.nodered.org/t/node-red-dns-resolution/51781/6 "2021-10-02T18:28:50Z")

</div>

But HA find Node-RED in a docker container, so it will be down to how they have set that up, just because you can resolve from the host doesn't mean you can resolve from within the container

---

<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: [1 December 2021 18:29 UTC](https://discourse.nodered.org/t/node-red-dns-resolution/51781/7 "2021-12-01T18:29:37Z")

</div>

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