Setting up a drush sql-dump alias I have the following in my aliases.drushrc.php file --

$aliases['prod'] = array(
    'uri' =&gt; 'foo.com',
    'root' =&gt; '/var/www/foo/htdocs',
    'remote-host' =&gt; '123.456.78.90',
    'remote-user' =&gt; 'bob',
    'databases' =&gt; 
      array (
        'default' =&gt; 
        array (
          'default' =&gt; 
          array (
            'driver' =&gt; 'mysql',
            'username' =&gt; 'foo',
            'password' =&gt; 'bar',
            'port' =&gt; '',
            'host' =&gt; 'localhost',
            'database' =&gt; 'foodb',
          ),
       ),
     ),
    'shell-aliases' =&gt; array (
        'dump' =&gt; '!drush sql-dump --gzip --ordered-dump',
    ),
  );


When I run drush @prod dump it attempts to connect to 'remote-host'. If I comment out 'remote-host' it dumps just as expected. I do need this value though for other functions such as sql-rsync.

I could create a new alias just for dumping but this seems a little excessive.

Any ideas?
Drush decides whether a site is local or remote via the function drush_is_local_host.  Make up a domain name for your system, such as foo.local, and make an entry for it in /etc/hosts (123.456.78.90 foo.local).  Next, make sure that /etc/hostname also contains foo.local, and confirm this by running hostname -f.  If you do all of this correctly, then you can set 'remote-host' =&gt; 'foo.local', and Drush will still treat it like localhost for commands such as sql-sync.