Redirect a Domain without Changing the URL with htaccess rule

Redirect and keep everything after the URL
RewriteCond %{HTTP_HOST} ^DomainA.com
RewriteRule ^(.*) https://DomainB.com/$1 [P]

Redirect a domain to a specific url
RewriteCond %{HTTP_HOST} ^DomainA.com
RewriteRule ^(.*) https://DomainB.com/PathToPageHere [P]

Redirect an IP address
# Redirect all IP address (replace the ## with the IP address numerals) to same https://domain_name.com
RewriteCond %{HTTP_HOST} ^##.##.##.##
RewriteRule (.*) https://domain_name.com/$1 [R=301,L]