Question

IP Connects But Domain Results in 'ERR_CONNECTION_REFUSED'?

Back-end newbie here who hasn’t been able to solve this with search-fu.

The site is working when accessed via the IP address but not the domain-- going to the domain returns ‘ERR_CONNECTION_REFUSED’.

I set up a PhpMyAdmin droplet. Domain nameservers are all on digital ocean and I have one ‘A’ record setup pointing at the IP. Domain is pointing to the correct IP on WhatsMyDNS. HTTP and HTTPS ports are allowed in UFW.

Anyone have insight on what I need to do to get this working? Thanks!


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Accepted Answer

An update on what I’ve figured out for anyone who might happen to have a similar issue and stumble upon this post:

I learned that I needed to setup the domain in apache (/etc/apache2/, sites-available and sites-enabled), but it didn’t seem to fix it. Tried LAMP installs and a PLESK install and none of those worked. Went back to a LAMP install and reverted the domain nameservers back to where I purchased the domain (Hover), didn’t seem to work.

Then poking around this morning I went to the domain in Edge and it worked there. Still didn’t work in Brave even after clearing the cache.

Turns out it was the automatic HTTPS upgrade-- I had to disable that and also clear all instances of the domain from my history. Working now! :P

Bobby Iliev
Site Moderator
Site Moderator badge
August 9, 2021

Hi there @psnapier,

I could suggest adding a CNAME record for your www version to point to your domain name.

If this does not work, what I could suggest is verifying that your A record points to the correct IP address.

Also, keep in mind that it might take up to a few hours for the DNS cache to clear over the Globe, so for example, if you’ve visited the domain via your browser before adding the A record, it is possible that you might have to wait a bit. To verify that, you could try pinging the domain:

ping yourdomain.com

Let me know how it goes! Regards, Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel