domain: add attributes support

Provide a method to pass certain attributes to a domain.