I may be mistaken, but I feel like a standard multi-environment configuration should work for you in this situation... specifically the use of environment-specific variables.
When you setup your multi-environment configuration, just set one up for each of your domain names. You would include something like this in your config/general.php file...
'my.first.domain' => array(
'environmentVariables' => array(
'siteUrl' => 'http://my.first.domain/'
)
),
'my.second.domain' => array(
'environmentVariables' => array(
'siteUrl' => 'http://my.second.domain/'
)
),
Once you've got that setup, login to your Control Panel and go to:
Settings > General
Change the value of Site URL to be "{siteUrl}".
Now, you can easily use any of these variations in your template:
{{ siteUrl }}/contact-us
url('contact-us')
siteUrl('contact-us')
It's a little tricky to explain the relationship between those three variations of "site url", but here's the gist of it...
When you set an environment-specific variable in your config file, it can be parsed by Craft (in certain circumstances) with the syntax {siteUrl}. Note the single set of curly braces, and the lack of spaces between the variable name and the braces.
The "Site URL" setting in your CP is capable of parsing out environment-specific variables. So when you put "{siteUrl}" in there, it represents whatever you put in your config file.
Now, when you use {{ siteUrl }} in your templates, it uses whatever value is represented by the "Site URL" value in your CP. Since we just told that field to use the environment-specific variable, that's what will be parsed through to the front-end.
In my example, I also mentioned url() and siteUrl(). These two functions will automatically prepend the "Site URL" value to whatever string you specify.
The difference between the two only really matters if you're rendering a template in the Control Panel (using a plugin). url() will prepend the entire site url, including the /admin/ segment... meanwhile, siteUrl() will only prepend the base site url.