Where is the base domain stored in database D7
I think you're looking for $base_url in /sites/default/settings.php.  As far as I know everything in the database works off this value, and it is not explicitly set in the DB