Two problems configuring Samba shares

I have an OpenWRT router that also does light duty as a central home
server (mostly for doing backups & serving music to my stereo system.)
The box's (local) IP address has two (local) hostnames, for its two
different purposes, so I can split the functionality onto two
different machines later, if I wish: router.local and home.local. The
true hostname of the box is "router."

I'd like the samba system to advertise its shares under the name
"home," not "router." I've run into two problems here.

First, I note that the smb.conf.template file sets the advertised
netbios name with this entry:

...
netbios name = |NAME|
...

The |NAME| bit is a template field that is supposed to be filled in by a
uci entry in /etc/config/samba4:

config samba
  option name home

If unspecified, it defaults to the machine's hostname, which (in my
case) is "router," not "home." But the uci mechanism is not working for
me: when I set the name option to home in /etc/config/samba4 (as
shown above) and restart the server, it does not use this setting
when it constructs the actual config file in /var/etc/smb.conf. I
can set the uci name option to anything I want, and the host name
"router" will still be substituted for |NAME| when
/var/etc/smb.conf is constructed.

Am I doing something wrong? How do set the |NAME| substitution in the
smb.config.template file? I know that I can simply hack the template
itself to crowbar the setting by removing the |NAME| reference entirely,
but that seems like the wrong thing to do. I'd prefer to use the uci
machinery correctly, as it is clearly specifically designed for this task.

(While I am writing, it also seems odd that the luci interface provides
no way to set this parameter. You have to do it with uci.)

The second thing I would like to do is advertise/publish the shares
under the name "home" to client machines that run linux & OS X. Using
the "Files" file browser in Ubuntu, I can go to the network:///
location and see servers offering shares. My router shows up as server
"router". The actual text url behind the friendly icon in Files is

network:///dnssd-domain-router._smb._tcp

(where the "router" part is, presumably, the host name of the system
offering the service.)

Can someone point me to a document on the OpenWRT site that will
tell me how to alter the DNS-SD advertisement for this service to use
the alternate host name?

EKH

You probably need to look back to what your samba config is, and what the shares are...

Hmm I wonder since I did something similar but on debian.

Won't it be easier to make samba listen on 0.0.0.0 (it likely already is), and then in the dhcp settings in OpenWrt you have dns records and then assign a A record and AAAA for ipv6 (if needed)?

I do it this way and it works for me, the only issue is that you cannot set 0.0.0.0 on the dns records so you may have to use lan gateway.

I noticed for the net share clients they can work with all domains if you add them manual even if the hostname is different.