Drupal multisite, Drush and parental aliases

Below is a method of using parental aliases to streamline your Drush alias configuration for your Drupal multisite. For clarity I've kept the alias definitions minimal.

In ~/.drush/aliases.drushrc.php:

<?php
/**
 * Parent aliases - local, dev, production.
 */
$aliases["local"] = array (
  'root' => 'c:/wamp/www/drupal', 
);
$aliases["dev"] = array (
  'root' => '/home/drupal/dev',
  'remote-host' => 'example.com',
  'remote-user' => 'username'
);
$aliases["prod"] = array (
  'root' => '/home/drupal/prod',
  'remote-host' => 'example.com',
  'remote-user' => 'username'
);

/**
 * Local aliases.
 */
$aliases["local.site1"] = array (
  'parent' => '@local',
  'uri' => 'site1.com',
);
$aliases["local.site2"] = array (
  'parent' => '@local',
  'uri' => 'site2.com',
);

/**
 * Remote aliases - dev.
 */
$aliases["dev.site1"] = array (
  'parent' => '@dev',
  'uri' => 'site1.com',
);
$aliases["dev.site2"] = array (
  'parent' => '@dev',
  'uri' => 'site2.com',
);

/**
 * Remote aliases - production.
 */
$aliases["prod.site1"] = array (
  'parent' => '@prod',
  'uri' => 'site1.com',
);
$aliases["prod.site2"] = array (
  'parent' => '@prod',
  'uri' => 'site2.com',
);

Test on the command line from multisite root directory:

drush @local.site1 status

Important note!

If you are maintaining your live sites remotely, you should implement a Drush policy file. See "Drush policy file to prevent catastrophes on live environments" for an excellent example.