If all of is on one droplet, do I need one A record, or one per hostname?

Suppose lives on a single droplet. It’s using digitalocean’s DNS servers

It has an A record for, with the droplet IP It has an MX record pointing to

Do I need an A record for Is this true for all DNS, or specific to digital ocean?

Is the same thing true for other pseudo-hosts (

Is the usual answer to run some kind of mini-nameserver on the main host, which happily says that it’s all of,,, etc.?

----simplified description of what I saw– What I’m seeing right now is that without the A record for, mail is bouncing. Specifically it claims that cannot be found.

But AFAICT, my previous DNS provider did not have an A record for*). And when I switched back to my old DNS provider, mail was once again received on the droplet

Much the same story with, except that it looked as if was successfully pointing to the nginx server on the droplet. (But maybe I was confused by DNS propagation delays.)

FWIW, the hostname I gave to the droplet is neither mail nor www.

And all the config files for postfix and nginx know about all the hosts they are supposed to be pretending to be - the only variable is DNS.

(*) note the AFAICT - I’m not sure precisely what I’d see if it did or didn’t have an A record, even with “dig all” Would that or would it not include

I’ve been making liberal use of commands like “dig all” to try to compare what the two are saying, but what I see doesn’t make sense given the pattern of bouncing mail etc.

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.

DigitalOcean Employee
DigitalOcean Employee badge
January 25, 2019
Accepted Answer

Hey friend,

Great question! You need to create an A record or CNAME for all hostnames that need to resolve. This is default DNS functionality and will be true anywhere. However, some hosting providers provide a pre-made set of DNS records for their own purposes. A common one would be cPanel based providers. Outside of such a curated environment, you end up having just a bit more work to do.

For your purposes, A record is what you want. When I mention CNAME that is to say you can create a record without giving it a direct IP, but that record must at least be an alias to another A record that does point to an IP. Commonly, the www record is made as a CNAME to the root domain, so as to simply alias it. Like this: A CNAME

That says “ can be found at, and can be found at wherever points to.”

Hope that helps :)


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