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

Posted December 10, 2018 5.2k views

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
  • Current hostnames for the droplets are and (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?

1 comment

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.

Submit an Answer
1 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 “” or even “” 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 to always use the IP address assigned to, and I want to update both records to a new IP address later by only changing one record. I would make “” a CNAME for “” which means that it always pulls the A record from “” when asked.

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


  • Right. A records for IPs and CNAMEs as aliases… that much I get. Just not sure what is typically recommended for such a setup. Also considering wildcards and @ records.

    • I would say that there is no recommended way, and that any choice which makes sense to you and also functions is the right choice as a result of that. A wildcard is a way to say “every subdomain that I have not already defined will point to this IP” and an “@” is simply a commonly accepted way to leave the name field blank, therefore referring to the root domain (ex.