Website sometimes returns DNS erro


I have been using Digital Ocean for over a year now. Lately (last 6 months~) I have noticed sometimes my sub-domains will return DNS errors. It seems to be random when it happens, and it is hurting the users of my site.

The only way I have been able to fix them is to edit the hosts file on my own computer, which is not productive.

My hosts file (on my DO droplet) is setup like this:

# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.redhat.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
#     /etc/cloud/cloud.cfg or cloud-config from user-data
# The following lines are desirable for IPv4 capable hosts my-site.2006 my-site.2006 localhost.localdomain localhost localhost4.localdomain4 localhost4
123.456.789.000 sited
123.456.789.000 cpd
123.456.789.000 forumd
123.456.789.000 wikid

# The following lines are desirable for IPv6 capable hosts
::1 my-site.2006 my-site.2006
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

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

Hi @blackoutro2006

There has been small delays/fallouts with the DigitalOcean name servers in some regions. It has been fixed now. That could be part of your problem.

But another problem is that you have set the TTL (Time To Live) to 0, which can lead to problems with some clients (your visitors computers), which might think the DNS is failing and it will never cache the DNS, so it needs to request a DNS every time. This can also lead to people getting blocked by the name servers, since it’s causing overload on the name servers.

What is the domain?

Try DigitalOcean for free

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

Sign up

Featured on Community

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