Question

What are the recommended DNS records for a web server and MQTT?

Not sure which DNS records I need to create to achieve the following goals. Wildcards? @? CNAMEs? A records? MX? It’s not clear how I should proceed. Please assist.

  • I own three domains and want all records in all 3 pointing to the same places. Eventually the domains will show different web content but for today they should be the same.
  • I will be standing up two droplets in a hot-cold configuration with a floating IP, manually controlled. Failover amounts to booting the second droplet and switching the floater.
  • I will be running a simple https Wordpress website (LAMP) on each droplet, resolvable by both www.domain and domain (no www.)
  • I will be running a MQTT broker on each droplet. The hostname the client is expecting for these is mqtt.SmartBird.io.
  • Current hostnames for the droplets are mqtt01.SmartBird.io and mqtt02.SmartBird.io. (Maybe I should have asked before committing to that naming scheme. Second one is not yet created, and I can easily rebuild the first.)
  • Mail is to be handled by Zoho

What records should I create, pointing to what?

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.

jarland
DigitalOcean Employee
DigitalOcean Employee badge
December 10, 2018
Accepted Answer

Hey friend,

To best determine what each should be, I think it’s best to break down what the record types are for. Each has it’s use case. You already have MX handled, so let’s talk about A records and CNAMEs:

A record - This points a name to an IP address. The name might be “domain.com” or even “sub.domain.com” but it simply points to an IP address.

CNAME record - This points to an A record, and pulls the IP from it. Let’s say that I want sub.domain.com to always use the IP address assigned to domain.com, and I want to update both records to a new IP address later by only changing one record. I would make “sub.domain.com” a CNAME for “domain.com” which means that it always pulls the A record from “domain.com” when asked.

Each has it’s use case, and which to use at each point is entirely your decision :)

Jarland

Try DigitalOcean for free

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

Sign up

Become a contributor for community

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

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.