Configure DNS record so all subdomains of one domain work with yunohost?

I’m wondering if anyone has tried a setup where they configure the DNS record for one domain such that every subdomain of that domain works with yunohost, without further modification?

or if such a configuration could be possible?

for example if the domain was mydomain.com,
mail.mydomain.com
nextcloud.mydomain.com
ether.mydomain.com

could all be subdomains to be used with yunohost. I would still need to add each subdomain as a “domain” through the yunohost interface, but such that no further DNS modifications would be necessary.

currently, I create a new bind9 configuration for each new subdomain for each new app, using a small script to copy a template… but maybe there is some way to make this unnecessary?

in particular as I help setup non-technical users, it seems like such a configuration could be useful

curious to hear any setups or thoughts

This is something I am also interested on.
For each subdomain I need to go and create two entries on my DNS provider:

  • A record, pointing to my server IP
  • AAA record, pointing to my IPV6 server IP

The funny thing is that, I add values for a subdomain, an then the sub-sub domain of that name (which is what I want) also works.

So, I have my domain like yuno.mydomain.com, and I want to create xxx.yuno.mydomain.com then I need to ad two A and AAA records for xxx in my DNS provider, and then both xxx.mydomain.com and xxx.yuno.mydomain.com will work.

So, one year later here we are again.
Will love to know if anyone has an answer to this question, because it is a bit cumbersome to manage several subdomains every time I want to add an app or two

As far as I know, just add a wildcard (*) A / AAAA record on the top domain (if I remember correctly, this is recommended by YunoHost’s proposed DNS conf) and you won’t have to configure an A / AAAA record for every subdomain …

Agreed, I have this setup, as specific DNS records have priority over wildcard ones.

I have all the DNS records recommended by YunoHost for

  • maindomain.tld and *.maindomain.tld pointing to my VPS
  • onerpi.maindomain.tld and *.onerpi.maindomain.tld pointing to my Raspberry Pi at home.
  • anotherrpi.maindomain.tld and *.anotherrpi.maindomain.tld pointing to a secondary location equipped with another Raspberry Pi.

A and AAAA records are one thing, but YunoHost Diagnose will also nag me about CAA, SPF, DKIM, and DMARC records. Will a wildcard approach work here too to make those warnings go away? Could it cause problems with other subdomains that do not point to my YunoHost server?

I think complementing *.example.tld wildcard domains with wildcard certificates ( Wildcard certificates, anyone? all user's exposed apps tracked (public cert database) ) is well tested.

I have had a look at DKIM options and it seems the domain key is actually valid for subdomains by default, that is when there is no t=s; configuration in the `selector._domainkey` DKIM DNS TXT record, which is also yunohosts default.

DMARC1 also has a subdomain policy setting sp=; that suggests it would be used as default for further subdomains.

So, it could be just yunohost doing a bit “too much” here.

(too much keytable, signingtable and keys in /etc/dkim)

Unnecessarily opting to create, use, and configure a different domain key for each subdomain?

Maybe or maybe not, if someone want to migrate an app on a subdomain on another server, it could be useful to seperate things. But yes it’s quite annoying to fill all those DKIM DNS records…

On my side on some setup i just set the same keys for all subdomains in /etc/dkim by copying it.

Ah, yes. Couldn’t that just be the default, otherwise maybe a checkbox, for domain- or app-install settings?

Reuse SPF/DKIM/DMARC settings from parent domain?


As you speak about moving apps/domains, I actually had just noticed that all yunohost installations seem to use the same DKIM selector string, which creates conflicts in this case.

Is the selector maybe already configurable at some place in yunohost?

Hm, maybe it’s actually usefull to use the seme selector by default. As moving to another server’s domain can automatically use the new server’s keys under the same selector?

So there is no need to require copying keys between servers by default?
While it would still also remain simpler to do so, for example in case of a fallback server when using the same selecor.