How to see which database Craft is currently connected to? I was able to install Craft using a Vagrant/Homestead setup, but I can't seem to connect to the database I want. I set up my hosts file to point to a '.dev' address while working locally on my machine.

My db.php file seems to be set up ok:

return [
  '*' =&gt; [
    'server' =&gt; 'localhost',
    'tablePrefix' =&gt; 'craft',
  ],
  '.dev' =&gt; [
    'database' =&gt; 'dev',
    'user' =&gt; 'homestead',
    'password' =&gt; 'secret',
  ],
  '.org' =&gt; [
    'database' =&gt; 'prod',
    'user' =&gt; 'root',
    'password' =&gt; '********',
  ],
];


When I ssh into my vagrant box and log into mysql, I can SHOW DATABASES and see:

+--------------------+
| information_schema |
| dev                |
| prod               |
| homestead          |
| mysql              |
| performance_schema |
+--------------------+


I'm overwriting the dev, prod and homestead databases with a backedup .sql file, however when I visit my local '.dev' address, my Craft site doesn't appear to carrying over any of those changes. 

Is there a way to see which database Craft is actually connected to?
You could do something like this to at least see which environment from your multi-environment config that Craft is matching:

$craft = require 'path/to/craft/app/bootstrap.php';
echo $craft-&gt;config-&gt;get('server', ConfigFile::Db);