Change mDNS hostname?

Just installed Channels DVR on my NAS and it’s pretty awesome, love how simple it makes everything on the Apple TV.

One small gripe however is the default behaviour of channels choosing its own mDNS hostname by prefixing the standard hostname with “dvr-”.

Is there any way of changing the hostname Channels DVR uses? I’ve looked through various configuration files and inside settings.db but can’t find a reference to the hostname, suggesting this naming is hardcoded. Tried guessing some HTTP endpoints too (e.g. /bonjour/hostname) as I’d seen examples of changing the network interface like this, but nothing seems to work.

Is this possible, and if not, can it be implemented?

Some background, in case you’re wondering why I want to change the hostname:

In my case I’m running NAS4Free, which is very similar to FreeNAS (used to be FreeNAS!), but as it doesn’t understand FreeNAS plugin files I had to manually install the DVR software using the Linux/FreeBSD instructions. NAS4Free likes to run in “embedded” mode where it reloads the whole OS volume from an image on a USB drive on boot, so you’re advised to create jails to run various other services inside, which are like mini FreeBSD installations in their own right that are persistent after reboots (stored with all the user content/data on disk) and have their own hostname.

Installing the DVR to a jail worked great using the instructions for FreeBSD, but the automatic hostname choice is a little annoying. Jails shouldn’t use the same hostname as the machine they’re running on to avoid conflicts, so I used the hostname nas-dvr.local for the jail, appending “-dvr” to the machine’s hostname (nas.local). Obviously when Channels DVR starts it then prefixes this with “dvr-”, meaning the advertised hostname for Channels is dvr-nas-dvr.local, which is silly. I’d like this to be either dvr-nas.local or ideally nas-dvr.local, i.e. stop Channels adding the hostname prefix, but as I can’t use nas.local for the jail’s hostname, this isn’t possible.

Clearly this isn’t a huge problem but it would be nice to have control over the hostname, just so it makes more sense in cases like mine.

The dvr- prefix is hardcoded and there’s no way to change it. The prefix was added because some systems advertise hostname.local and others don’t, so advertising for hostname.local ourselves caused problems.

Let me think about this and see what makes sense. I guess an endpoint to set a custom hostname wouldn’t be too bad…

Can you resolve nas-dvr.local on your network to reach your jail? If so, http://nas-dvr.local:8089 should work to access the DVR

Thanks for the quick replies, much appreciated.

No, unfortunately not, I forgot to mention I’d tried that already. However thinking about why this doesn’t work, the jail in question doesn’t actually have mDNS set up on it, which is presumably required for resolving that domain. With that in mind I tried changing the hostname of the jail to the same as of the machine (nas.local) and nothing has broken, plus I can now use http://dvr-nas.local:8089 to access Channels successfully. I guess there’s no conflict as the jail doesn’t actually advertise nas.local (the main NAS machine does, but that doesn’t matter).

So I guess this has inadvertently solved the problem! Thanks for your help :slight_smile:

Might still be useful to have the ability to change the hostname though, I like the idea of it being another HTTP endpoint.

1 Like

Has the feature to create a custom hostname ever been implemented? Or is the prefix still hardcoded?

It's still hard coded. No one has cared in the last three years so I forgot about it.

Is it causing you problems?

For the setup I have, no, it has not caused any problems. It is purely cosmetic.

I have dvr in the name already, so I have dvr twice.

Ignorance on my part, but if Channels already has a chosen port 8089, are there circumstances that require a different hostname from the host that would require one to add dvr-?

The problem is we don't know reliably whether the system is already advertising its hostname over bonjour or not. Some systems are setup do it, some are setup but incorrectly, and others don't have any mDNS/avahi services installed.

So the easiest thing is for us to generate a unique hostname and advertise that using a bonjour stack that is completely within our control.

so why not let folks change the hostname if thats completely in your control?

i just found this because i don't like the name dvr-syn02.local and would prefer to set as dvr.local

(actually i would really like to use dvr.mydomain.com and be able to HTTPs the web traffic with my own certs, but thats probably beyond this threads context)

1 Like

If you have such control over your own network, then the published name doesn't matter much, as you control the DNS. Channels just uses dvr-${HOSTNAME}.local for mDNS. There is nothing stopping you from using your own DNS server to additionally name the server.