IP address still showing in address bar after domain resolves

Posted December 17, 2016 26k views

I have a domain, ‘’, registered with Bluehost. I also have a droplet with DigitalOcean. Now, I’ve re-pointed the nameservers to use CloudFlare. Great.

After adding the DNS entries, I go to a browser and type in '’ … it properly resolves to the correct IP address of the correct Droplet.

But: in the browser bar, upon resolution and display of the Droplet’s server page, the address bar then stops displaying the domain - and, instead, exposes the IP address.

I have tried a 1000 different configurations - including trying same for a subdomain.

However, nothing seems to correct the problem, preserve the domain/subdomain in the address bar, and not display the IP address.

Here’s what I get:
Domain: –>
Subdomain: –>

What am I doing wrong??

1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers

Is this a static site or are you using a CMS like WordPress? We see this issue quite a bit when WordPress sites are created and the setup is done before a domain is assigned. WordPress will set the SiteURL setting to the IP address and by default will direct any requests it receives to use it’s configured URL/hostname. If this is the case you can change this setting in the General settings section of /wp-admin

If you’re running a static site or something else, can you share your virtualhost configuration and if one exists, the content of any .htaccess file located in your web root directory?

This is not related to DNS. What you are describing is a redirect done at the web server or application level (A DNS issue would prevent the name being resolved but has no ability to force a particular URL to show up in your address bar)

I have the same issue with Magento 2.x Anybody has an idea how to go about this in Magento? I tried editing “/etc/apache2/apache2.conf” and replaced the IP address with the domain but still not working. Anybody knows what do?

I had the same issue with my Wordpress site. I logged in and went to settings and it was set to http://ip address. I changed it to and saved the settings. When going back to the website, it displayed the domain name instead of the ip address.

  • Hi, I have the same issue. Could you explain what “settings” and where D.O. Or WP you went into so I can try and find success too. Thank you.

    • I had this problem. This is the way I fixed it.
      Log in to your WP site, go to settings, general. There you find two entries
      WordPress address (URL)
      Site Address (URL)
      Replace the IP address in those two entries with your domain.

Yup. I got the same problem, and problem was wordpress configuration. Thanks for help. GL