# NodeRED DNS resolution issue

**URL:** <https://discourse.nodered.org/t/nodered-dns-resolution-issue/39406>\
**Category:** Core Development\
**Created:** [19 January 2021 21:15 UTC](https://discourse.nodered.org/t/nodered-dns-resolution-issue/39406 "2021-01-19T21:15:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lemonka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lemonka/32/35632_2.png) [@lemonka](https://discourse.nodered.org/u/lemonka)\
**Post date:** [19 January 2021 21:15 UTC](https://discourse.nodered.org/t/nodered-dns-resolution-issue/39406/1 "2021-01-19T21:15:49Z")

</div>

I'm having suspicion that NodeRED is using its own DNS servers instead of system ones....

1. Im having locally running on Docker PiHole where I have defined some local domains.
2. NodeRED is running on separate Docker. While using HTTP request to locally defined domain my request is timing out (as I block internet-\>home connections), so I decided to test output from module DNS and Im getting public address.

How to force NodeRED to use system defined DNS ?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 January 2021 21:28 UTC](https://discourse.nodered.org/t/nodered-dns-resolution-issue/39406/2 "2021-01-19T21:28:31Z")

</div>

The DNS server that any service uses is defined at the network layer not in the service.

Check what DNS server(s) your server is using.

Have you updated your router's DHCP settings to issue the PiHole server as the DNS server? Or are the IP settings of your server set manually and do they need changing?

---

<div class="post-metadata">

**Author:** ![lemonka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lemonka/32/35632_2.png) [@lemonka](https://discourse.nodered.org/u/lemonka)\
**Post date:** [19 January 2021 21:40 UTC](https://discourse.nodered.org/t/nodered-dns-resolution-issue/39406/3 "2021-01-19T21:40:33Z")

</div>

Thats kinda weird... as Im opening Node RED via mydomain\_com:1880 (which is actually local dns ip 10.1.1.100) but if I do dns query within Node RED im getting public ip assigned to mydomain\_com and when I use  
`# dig mydomain_com `  
im getting 10.1.1.100...

---

<div class="post-metadata">

**Author:** ![lemonka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lemonka/32/35632_2.png) [@lemonka](https://discourse.nodered.org/u/lemonka)\
**Post date:** [19 January 2021 21:43 UTC](https://discourse.nodered.org/t/nodered-dns-resolution-issue/39406/4 "2021-01-19T21:43:16Z")

</div>

Is there by any chance that Docker is having DNS somewhere defined? or managed?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [19 January 2021 22:22 UTC](https://discourse.nodered.org/t/nodered-dns-resolution-issue/39406/5 "2021-01-19T22:22:40Z")

</div>

Node-RED does not set or manage name resolution - that will be down to your environment somehow. As you are using Docker I would start with the docs for that - [Container networking | Docker Documentation](https://docs.docker.com/config/containers/container-networking/) - but by default it just picks it up from the host.

---

<div class="post-metadata">

**Author:** ![lemonka](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lemonka/32/35632_2.png) [@lemonka](https://discourse.nodered.org/u/lemonka)\
**Post date:** [20 January 2021 13:29 UTC](https://discourse.nodered.org/t/nodered-dns-resolution-issue/39406/6 "2021-01-20T13:29:57Z")

</div>

I have added

```auto
network_mode: "host"        

```

to docker-compose.yaml file - and now it works ok. Without NodeRED was not even able to communicate with IP specified DNS. Im not expert here so this topic can be closed and explained more by someone more experienced 🙂

---

<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:** [3 February 2021 13:30 UTC](https://discourse.nodered.org/t/nodered-dns-resolution-issue/39406/7 "2021-02-03T13:30:04Z")

</div>

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