NodeRED DNS resolution issue

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 ?

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?

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...

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

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 - but by default it just picks it up from the host.

I have added

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 :slight_smile:

1 Like

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