How to load all aliases of a domain I'm using the modules domain and domain_alias on Drupal 8.

I need to load all the aliases of a given domain.

I have tried the following without success:

$aliases = \Drupal::service('entity_type.manager')-&gt;getStorage('domain_alias')-&gt;loadByHostname('my.domain.com');

$aliases = \Drupal::entityTypeManager()-&gt;getStorage('domain_alias')-&gt;loadByProperties(['hostname' =&gt; 'my.domain.com']);
Got it.

The 'hostname' is not a property of the alias. The way to get the aliases is:

$aliases = \Drupal::entityTypeManager()-&gt;getStorage('domain_alias')-&gt;loadByProperties(['domain_id' =&gt; 'my_domain_id']);


Note that 'my_domain_id' is specific to the domain that you are trying to get the alias for.