Aliases for a static IP with name and domain name?

I’m able to setup a domain name on VLAN1 (mydomain.example)
I’m able to set a name and IP for a device connected (server1, ip:10.10.10.12)
I can PING and do an NSLOOKUP to server1.mydomain.example and i get a reply with the correct IP 10.10.10.12

my problem is that the host in question has a bunch of docker containers running and i would like to be able to setup some aliases for it. example:
plex.mydomain.example → 10.10.10.12
jellyfin.mydomain.example → 10.10.10.12
whatever.mydomain.example → 10.10.10.12

Can (and if yes how) we setup aliases for a static IP with name and domain name ? I looked under root@Route10:/etc/config/dhcp but i dont want to mess anything up on the front end.

according to a post on OpenWrt forums, we can do this with cnames.
i did it via ssh on route10, and it worked
…but the setting is gone after reboot. :frowning:

For the time being (until we add something like this in the UI), you can use the /cfg/post-cfg.sh script, which will run after every configuration change automatically. This could persist your manual changes through reboots. Of course you will need to be careful with this option.

@Alta-Jeff – thanks for the tip.
i was able to create the /cfg/post-cfg.sh file and this is the content if anyone needs it as example:

#!/bin/sh

#Add CNAME records
uci add dhcp cname
uci set dhcp.@cname[-1].cname="server01.example"
uci set dhcp.@cname[-1].target="server.example"

uci add dhcp cname
uci set dhcp.@cname[-1].cname="server02.example"
uci set dhcp.@cname[-1].target="server.example"

#Commit changes
uci commit dhcp
1 Like