# Accessing node red container using i'ts host name

**URL:** <https://discourse.nodered.org/t/accessing-node-red-container-using-its-host-name/72780>\
**Category:** General\
**Tags:** docker\
**Created:** [27 December 2022 19:07 UTC](https://discourse.nodered.org/t/accessing-node-red-container-using-its-host-name/72780 "2022-12-27T19:07:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![matbli](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@matbli](https://discourse.nodered.org/u/matbli)\
**Post date:** [27 December 2022 19:07 UTC](https://discourse.nodered.org/t/accessing-node-red-container-using-its-host-name/72780/1 "2022-12-27T19:07:00Z")

</div>

Hi,

I have set up a docker ipvlan on my Rpi and started one (or several) node-red container(s) using this ipvlan, and it gets its own IP address on my LAN and node-red is accessible using this IP address from anywhere on my LAN. But it is not accessible using its hostname as is the host Rpi it's running on.

I have tried installing Avahi in the container but with no real luck.

I thought it better to first ask what would be the best approach to get this to work. I.e making the node-red container respond to requests using its hostname.

/Mats

---

<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:** [28 December 2022 13:57 UTC](https://discourse.nodered.org/t/accessing-node-red-container-using-its-host-name/72780/2 "2022-12-28T13:57:07Z")

</div>

Did you specify hostnames for the docker containers?

Also, are you using a local DNS? E.g. from your Router? If so, you should specify that to the container as well I think.

---

<div class="post-metadata">

**Author:** ![matbli](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@matbli](https://discourse.nodered.org/u/matbli)\
**Post date:** [30 December 2022 11:02 UTC](https://discourse.nodered.org/t/accessing-node-red-container-using-its-host-name/72780/3 "2022-12-30T11:02:26Z")

</div>

The container gets its container id as hostname by default, but I have tried to set a hostname using the docker hostname parameter, but still no access through use of the name.

The container host has Avahi running and is accessible by name through mDNS, I believe, so I don't think I should need any local DNS on my network.

I will continue to see if I can get Avahi running in Alpine in the container.

Another thing, not so important, is that the container is not accessible from the host even via its IP as from elsewhere on the LAN.

---

<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:** [30 December 2022 16:44 UTC](https://discourse.nodered.org/t/accessing-node-red-container-using-its-host-name/72780/4 "2022-12-30T16:44:54Z")

</div>

> [@matbli](#):
>
> Another thing, not so important, is that the container is not accessible from the host even via its IP as from elsewhere on the LAN.

I understand that to be a security feature when using ipvlan. I'm sure the docker docs mentioned it.

---

<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:** [28 February 2023 16:45 UTC](https://discourse.nodered.org/t/accessing-node-red-container-using-its-host-name/72780/5 "2023-02-28T16:45:31Z")

</div>

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