Encrypting a broadcast message decryptable by a subset of receivers
Perhaps Attribute-based Encryption is what you are looking for.
From the two schemes (KP-ABE, CP-ABE), CP-ABE can solve your problem. You can set the attributes of each identity according to their domain set and encrypt the file with policy using OR. The example you have given, Msg(D1,D3) can use (D1 OR D3) as a policy to encrypt.
For more detailed information on the mathematics behind the scheme, you can read this paper. Also, there is an opensource implementation available too Zeutro's OpenABE if you are interested.