Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Docker Hostnames

Featured Replies

  • 4 weeks later...
  • Author
On 5/14/2020 at 1:34 AM, saarg said:

You can already do this using the extra parameters field.

Can you point me in the right direction? Where can I read up on this?

3 minutes ago, ethanpil said:

Can you point me in the right direction? Where can I read up on this?

There isn't much to read up on.

Toggle to advance mode in the top right corner of the container template and the extra parameter field is visible. Then you can add whatever docker parameter you need.

  • 5 months later...

Did you get this working as I have tried the hostname etc and still can't access by hostname ?

  • 1 month later...

I'm curious on this as well.  I'd like to set it up with something like:

plex.tower

sonarr.tower

pihole.tower

 

 

  • 3 weeks later...

Hi,

 

I was wondering if anybody could help me?  

 

I have a container - linuxserver/unifi-controller  and I have a manual IP assigned, I have hit advanced > extra parameters, have added

--hostname unifi-ctrlr 

 

root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='unifi-controller' --net='br0' --ip='192.168.100.2' -e TZ="Australia/Sydney" -e HOST_OS="Unraid" -e 'UDP_PORT_3478'='3478' -e 'TCP_PORT_8080'='8080' -e 'TCP_PORT_8443'='8443' -e 'TCP_PORT_8880'='8880' -e 'TCP_PORT_8843'='8843' -e 'UDP_PORT_10001'='10001' -e 'PUID'='99' -e 'PGID'='100' -v '/mnt/user/appdata/unifi-controller':'/config':'rw' --hostname unifi-ctrlr 'linuxserver/unifi-controller'

2dcfd7d24e972ce44a0c44cf945e4685784659d778b54a613ce75886b444a9ac

The command finished successfully!

 

Anyway, the hostname doesn't appear to be assigned to the docker.  

 

Same thing for plex.  

 

Anyone have any ideas?

 

Cheers

 

Nik

Docker doesn't/won't do this natively because it doesn't run a DHCP client. Registering hostnames in DNS is a function of the DHCP protocol and since the docker containers don't run a DHCP client, it'll never register those things in DNS.

 

The hostname parameter only allows you to specify the hostname of the container itself otherwise it uses the containers randomly assigned ID number as the hostname (it's useful if you have an application that requires a static hostname).

I could be wrong here but I don't think that any setting, whether it is on the docker configuration or contained within Unraid somewhere, would have the effect that you want.  Whatever you set on the docker would apply to it's network only, and whatever was set on Unraid would apply to it's network only.    If that makes sense..

 

When you're on your computer you're resolving DNS through your router's dhcp/dns which isn't going to know anything about Unraid or docker containers. 

 

So from my point of view you only have 2 options... 

 

1) Every computer you use would have to have [i][u]it's[/i][/u] hosts file changed to include the hostnames you want, or

2) Have a router capable of setting custom hostnames... not sure if this is even a thing..

 

And I mean... then.... you know.... you could always bookmark the sites in your browser......... and not have to think about it.

  • 4 weeks later...
On 1/16/2021 at 11:46 AM, np226 said:

Hi,

 

I was wondering if anybody could help me?  

 

I have a container - linuxserver/unifi-controller  and I have a manual IP assigned, I have hit advanced > extra parameters, have added

--hostname unifi-ctrlr 

 




root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='unifi-controller' --net='br0' --ip='192.168.100.2' -e TZ="Australia/Sydney" -e HOST_OS="Unraid" -e 'UDP_PORT_3478'='3478' -e 'TCP_PORT_8080'='8080' -e 'TCP_PORT_8443'='8443' -e 'TCP_PORT_8880'='8880' -e 'TCP_PORT_8843'='8843' -e 'UDP_PORT_10001'='10001' -e 'PUID'='99' -e 'PGID'='100' -v '/mnt/user/appdata/unifi-controller':'/config':'rw' --hostname unifi-ctrlr 'linuxserver/unifi-controller'

2dcfd7d24e972ce44a0c44cf945e4685784659d778b54a613ce75886b444a9ac

The command finished successfully!

 

Anyway, the hostname doesn't appear to be assigned to the docker.  

 

Same thing for plex.  

 

Anyone have any ideas?

 

Cheers

 

Nik

 

I've been using this feature in docker-compose files (without unraid) but here I cannot get it to work.

One walk-thru has been to edit /etc/hosts and identify each container with it's ip like.

 

root@Tower:~# cat /etc/hosts
# Generated
127.0.0.1       Tower localhost
54.149.176.35   keys.lime-technology.com
172.20.0.11 mqtt
172.20.0.15 mariadb

 

Is not perfect but works

14 minutes ago, MiQUEL said:

 

I've been using this feature in docker-compose files (without unraid) but here I cannot get it to work.

One walk-thru has been to edit /etc/hosts and identify each container with it's ip like.

 

root@Tower:~# cat /etc/hosts
# Generated
127.0.0.1       Tower localhost
54.149.176.35   keys.lime-technology.com
172.20.0.11 mqtt
172.20.0.15 mariadb

 

Is not perfect but works

Be aware with this method (and network config) that those docker IPs are subject to change.

  • 1 month later...

not if they are defined in the appropiate input text when you configure it, right?

Although i don't really like how dockers behave if you create it directly with the assistant. I dont see a way to control them as I used to do with docker-compose, I dont know any option like "depends_on". And I think this is a must in complex environment where you need to be sure that X Y and Z have to be running before start A and B containers.



 

  • Community Expert
3 hours ago, MiQUEL said:

I dont know any option like "depends_on". And I think this is a must in complex environment where you need to be sure that X Y and Z have to be running before start A and B containers.


You  CAN control the order in which docker containers are started under unRaid by re-ordering them on the Docker tab and also set delays in the sequence to allow for initialisation of specific containers before continuing with loading further containers.    I would have thought for most use cases this was sufficient?

  • 5 months later...
On 5/14/2020 at 4:34 AM, saarg said:

You can already do this using the extra parameters field.

 

Would you mind explaining how? Because I cannot find any `hostname` option in advanced.

1 hour ago, Squid said:

Advanced View

 

Doh! I didn't even see that advanced view link in the top right corner. Thank you!

Okay so I think I am missing something. The hostname is getting set but two Docker containers both using Bridge network can't resolve each other's hostnames. When I was using Docker Compose all I had to do was set the hostname and then another container could resolve the IP of that container using hostname. Is there a way to get this to work with unRaid?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.