Here's what I've used:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
What this does is:
1. Turns on the URL rewriting engine in Apache
2. Sets the base URL to the root of the domain
3. Checks if the requested URL is not the new domain using case insensitive matching via the [NC] flag
4. Specifies the new URL to be the same as the requested URL, with the domain name changed to the new domain.
The L flag specifies this is the last rule to evaluate if a match is found and R=301 specifies that a HTTP 301 redirect is sent, which flags that the requested page has permanently moved to the new domain location.
-i