Enotfound error when performing http request to a hostname

I have node red running inside a docker container. I want to perform a http request but get ENOTFOUND error. If I do the same request to the IP it works fine.

Ive spoken to the manufacturer and they have said to use mDNS. Its a bit out of my depth at this point so Im after some advice to ensure I have node red and the container set up correctly first.

I have a network with no DNS defined. There is a DHCP server that is handing out IP addresses to the devices in question. From my laptop I can perform the http request in the browser using the hostname fine. The device running docker has and for the DNS addresses which I believe will help resolve names outside of the network?
When creating the nodered container I need to define the docker options and the only way to change them is to delete and recreate the container. This isnt a problem now because I have no data to lose. But how do I define the options for mDNS in the container options? I dont even really know what that means, I would imagine its another service. Should I run some mDNS service in another container?

Also, I dont know if Im just looking in the wrong place, but it feels impossible to find any details about what options are available for docker containers. I think they are referred to as docker-compose.yaml files. The only way Im able to find anything is to find examples that others have used and happen to have posted online. I want to know what are all of the available options for a node red container, but I dont know where to find it?


Don't use docker unless you have a good reason. It just adds complications, as you have seen.

its the only option. In my case I have a device doing some job and has a docker environment on board where I need to do some processing of the data from the network. It may be complicated but really need to make it work.

Can they be pinged from inside node-red? (Install node-red-node-ping)

Being docker (an isolated operating system inside a host operating system), it needs networking to be setup appropriately.

yes, and can be pinged from node red. But aren't the related to hostnames on the internet? Im trying to get a local device. Ive done a bit more reading on mDNS and probably failed to explain properly due to lack of understanding.
Im trying to access the device via its name on the local network ie, myDevice.local

Ive found an avahi package I could install in another container then maybe point node red to this (im not sure if it would just work out of the box). Im not sure if the ability to do mDNS is built into node red?

This is nothing to do with node red, it is docker/OS related. Node red just passes the hostname or IP to the Docker/OS networking to sort out.

Ive read that adding --net=host to the docker options may do what I want so I just need to find out how to implement that to test. The device Im using has its own format for the file.

I have Node-RED running in a very very stripped down Linux container and have added a list of host names and IP addresses to the docker-compose file for local hosts:

      - "pi-server.local:"
      - "mac-server.local:"
      - "pi-support.local:"
      - "kermit.local:"

Normally I would just install avahi support but this container is so stripped down it does not even have apt in it to install packages!

Note this is not really recommended as IP addresses may change and device names added etc but this is a nice stable network and the boxes and Node-RED tasks are fixed for the foreseeable future.