Question

Windows hosts file point to droplet IP address

Hello. I’m trying to point my local hosts file on Windows to droplet IP address. Everything allright. ufw is disabled. Nginx config is correct. Any other IP address in hosts file resolves in correct way but this don’t.

Is there a way to solve this?

Show comments

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

.test domain goes wild. Any other domain works like a charm.

KFSys
Site Moderator
Site Moderator badge
February 13, 2023

Hey @littlegraysnorkler,

You need to add the following in your hosts.file on your Windows machine :

DROPLET_IP_ADDRESS DOMAIN_NAME www.DOMAIN_NAME

The file is located in c:\Windows\System32\Drivers\etc\hosts. Be sure to open it as an Administrator otherwise you can’t save the change made to the file.

Once that is done, open your CMD on your Windows laptop and try to ping your domain :

  1. ping Domain.com

If the IP shown is your Droplet’s than you are good to go.

If that is the case and you still can’t load the website then the issue is with your Nginx config. IF that’s the case you can post the config here and I’ll try to assist with that as well.

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