How to host your DNS with FastMail

DNS (Domain Name System) is the system used on the internet to translate domain names (e.g. www.example.com, fastmail.fm, etc.) to actual machines to contact. The process of converting a domain name to a machine to contact is called a "lookup".

Each domain can have multiple different result types for a lookup, called "record types". The three most common record types are NS records, A records and MX records.

DNS also allows other record types such as TXT, PTR and SRV records, which are used for various other less commonly used services.

Default DNS records

If you don't specify custom DNS settings for a domain, then our name servers will publish the following records for your domain:

yourdomain.com Type=MX     TTL=3600 STANDARD_MX
        (standard email - e.g. user@yourdomain.com)

*.yourdomain.com Type=MX   TTL=3600 STANDARD_MX
        (subdomain addressed email - e.g. user@mail.yourdomain.com)

yourdomain.com Type=A      TTL=3600 STANDARD_WEB
        (main website - http://yourdomain.com/)

*.yourdomain.com Type=A    TTL=3600 STANDARD_WEB
        (subdomain websites - including http://www.yourdomain.com/)

mail.yourdomain.com Type=A TTL=3600 STANDARD_MAIL
        (webmail login - http://mail.yourdomain.com/)

yourdomain.com Type=CSV    TTL=3600 CSV_DENY_ALL
        (no email sending machines identify as yourdomain.com)

yourdomain.com Type=JABBER TTL=3600 STANDARD_JABBER
        (standard chat server - chat.messagingengine.com)

These records are suitable for most users.

The meanings of STANDARD_MX, STANDARD_WEB, and STANDARD_MAIL are described below.

Custom DNS records

DNS can be a confusing and complicated system. If you get something wrong, you can bounce email sent to your domain, or cause your domain's website to stop working, and it can take hours or days to fix. For that reason, unless you understand what you're doing, or have been instructed explicitly by someone who knows what they're doing, we recommend that you don't modify the DNS for your domain.

Having said that, if you know exactly what you want to do, then the Custom DNS screen will let you create arbitrary DNS A, MX, etc. records for your domain or subdomains, allowing you to specify exactly what DNS records to publish for the domains you have setup at FastMail.

This allows you to:

Setup

Follow our domain set up instructions, making sure you choose the first option in step (4) and host your name servers at FastMail. Once this is done, we will publish default DNS records (see above) for your domain. You can then use the Advanced → Custom DNS screen to change the DNS records for your domain to whatever you want. Currently we support creating A, MX, CSV, CNAME, SRV, TXT and SPF records. We may add more in the future.

Wildcard DNS records

FastMail supports wildcard DNS records for subdomains using the standard * placeholder.

Note that wildcards only work for an entire subdomain. You can have *.mydomain.com, but you can't have abc*.mydomain.com.

If you specify a wildcard sub-domain, it's like a fallback value, and any specific entries you provide will override the wildcard. For example, if you have *.mydomain.com, and specify a record for abc.mydomain.com, then the abc.mydomain.com will be used when doing a DNS lookup on abc.mydomain.com. The *.mydomain.com record will be ignored.

Be aware that a specific entry for a sub-domain will override ALL records for that sub-domain. So if you have A and MX records for *.mydomain.com, and you specify just an A record for abc.mydomain.com, then there will be no MX records for abc.mydomain.com. If you want MX records, you must also specifically add them.

Setting DNS for websites hosted outside FastMail

If you have a website hosted at an external webhosting service, you need to add an entry to the DNS records for your domain to point to this service.

  1. Go to the Advanced → Custom DNS screen (Enhanced/Premier accounts) or Manage → Custom DNS screen (Business/Family Accounts).
  2. Choose the domain you want to edit DNS for and click Select.
  3. Change the radio button to Custom DNS and click Change.
  4. In the new custom DNS section, there will be two records with the value STANDARD_WEB. Change these two entries to the IP address given to you by your web host. If your webhost gave you a CNAME record instead of an IP address, see the section below.

CNAME only web hosts

Some website hosting places will only give you a CNAME record to point your domain to, not an IP address. This is a little trickier to set up and you have to be a bit careful. The core rule is: never set a CNAME record for your top-level domain (example.com), as this will break email delivery for your domain. Instead, do this:

  1. Set a CNAME record for www.example.com (remember, the www is important) with the value set to your web hosting provider's server name.
  2. Use the Advanced → Websites/Redirects screen to create a redirect from http://example.com to http://www.example.com.

This means anyone going to http://www.example.com will directly access your web host's server, and anyone going to http://example.com will be redirected by us to http://www.example.com.

Redirections

If the service you want to use doesn't support a custom domain, you can use a redirect instead to send users who go to http://blog.yourdomain.com to the hosted service (e.g. http://yourblogname.yourbloggingservice.com). You can even "cloak" the redirect so people still see the URL http://blog.yourdomain.com rather than http://yourblogname.yourbloggingservice.com.

To do this, go to the Advanced → Websites/Redirects screen and in the Create Website section at the bottom, choose "Redirect to external site" or "Cloaked redirect" in the "Publish as" section. You can even do this for your FastMail username, so http://blog.yourusername.fastmail.fm can be redirected to your blogging service.

STANDARD_* labels

Normally when specifying A records you have to specify an IP address, and for MX records you have to specify a priority and a host. For standard FastMail services however, you can use the special values STANDARD_MX, STANDARD_WEB and STANDARD_MAIL.

There's also another special name, STANDARD_SPF, which can be use for generating SPF records which say "mail is only sent via FastMail". We don't add these by default because many people send outbound email via their ISP or work email systems as well.

By using these special values, you avoid the need for hardcoding particular IPs/hostnames in case they should change in the future.