It's actually more complicated:
When foo.example.com is a domain that we know about, then fqdn=foo.example.com needs to separate into (name=@, domain=example.com)
When the domain bar.example.com is created and RRsets exist for bar.example.com, dnsresource.{name,domain} need to be updated to accept the insertion.
There should never be entries (name=baz, domain=example.com) when the domain baz.example.com exists in Domain.
It's actually more complicated:
When foo.example.com is a domain that we know about, then fqdn=foo. example. com needs to separate into (name=@, domain=example.com)
When the domain bar.example.com is created and RRsets exist for bar.example.com, dnsresource. {name,domain} need to be updated to accept the insertion.
There should never be entries (name=baz, domain=example.com) when the domain baz.example.com exists in Domain.