Redirect from ip to domain

WordPress does not create a complete new .htaccess. It just rebuilds the part between the WordPress markers:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Any rule placed outside of this block will not be touched.