You can achieve this with a rewrite in an htaccess file in your website’s directory.
You will want to create an .htaccess file in that directory with the following (replacing the IP and domain with your own):
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^123\.456\.789\.123$
RewriteRule ^(.*)$ http://www.domainname.com/$1 [L,R=301]