ReachCustomersOnline.com supports RedWrangler.com subscribers and anyone in search of low cost internet marketing know-how

How To Easily Edit DNS Zone Files To Configure Email Servers

Earlier this year, and again this week, I had to configure a client’s email once they moved to a new web hosting vendor. In both cases, they had old webhosting contracts that cost too much, around $30 USD a month when $10 or $20 a month provides much more bandwidth, disk space, and other features. In both cases, I had to cobble together information to get the email configuration done. This article is a summary of what I found works.

While this topic can be highly technical, I only want to describe the minimum an average non-technical person needs to know to configure their website and email settings. It is not rocket science. Nor is hair ripping failure pre-ordained.

The first point to make is that many businesses use an in-house email server to collect email from the internet and route it to everyone within their company. This requires a dedicated internet address for their email server. If they do not host their website, and many do not, this requires their web server to be configured to route website traffic to one internet address (their domain name) and email to another internet address (their in-house email server). Put another way, while it is possible to use a web server to collect and store email that you can view with a web browser, most businesses never use this option. So you have to configure email to go from the web server to the in-house email server.

Configuration is handled through a DNS (Domain Name System) zone file. If you do not know, when you type a domain name (e.g., www.bedrock.com) into a web browser, or you send an email, software on the internet translates your request into an internet address using DNS, a distributed Internet directory service. Domain names exist strictly to help make the internet more human readable. However, internet technology uses four part “dotted IP” or “decimal IP” addresses, for example, 1.1.1.1 to uniquely identify devices connected to the internet.

The DNS zone file itself is simply a list of configuration settings in a specified order and format. When someone requests a translation of a domain name into an internet address, the DNS zone file is searched to retrieve the correct address. Translations are either forward (from a domain name to an internet address) or reverse (from an internet address to a domain name).

The core of the DNS file is a record type with their own settings. Here are the key record types most non-technical people will encounter when they configure their website and email addresses:

SOA. The start of authority is the first record type in any DNS zone file. It provides settings for the domain name of the primary DNS server for the zone, the contact email address, a unique serial number for the zone file, and intervals for refresh, retry, expire, and time to live (TTL).

NS. The name server record type identifies each DNS server within a zone. Most websites have two DNS servers for redundancy backup. While the primary DNS server is listed in the SOA record type, all DNS servers must have individual NS record types. If you are a website reseller and have your own name servers, each of your name servers should have one NS record within the zone file.

MX. The mail exchange record type identifies the mail server(s) for your domain. You can have multiple MX record types to ensure redundancy. Settings for this record type include preference (with the lowest number having highest preference) so that any request to identify your mail server will work through your list of mail servers in the order you specify. The MX record must point to a domain name that follows the mail.yourdomain.com format.

A. Each MX record type also needs to have a corresponding address record type. This record type assigns the mail to a specific internet address.

The TTL (time to live, how quaint) determines how often other parts of the DNS registry check your zone file for updates. A high setting means fewer visits and less bandwidth but also means your changes will take longer to propagate through the DNS system.

To change my client’s mail configurations, I only had to add an MX record type and an A address record type that included the internet address for their in-house email server. I also added one NS record type for each of my name servers. This was much easier than it sounds (see below). To do more than mail configuration with your zone file, you might work with these zone file record types:

CNAME. Because computers attached to the internet often perform more than one role, the cname record type allows you to create aliases for a single resource. One typical use is to create an A record type for the yourdomain.com requests that points to an internet address and one cname record for www.yourdomain.com requests that points to yourdomain.com. Cname record types should point to address records (which point to internet addresses) and not other cname records. This avoids infinite reference loops.

TXT. This record type is used for human readable comments (like, “Hey somebody actually reads my zone file.”)

PTR. This record type maps an internet address to a domain name for reverse translation requests.

You can edit DNS zone files several ways. I’ll describe how to use Web Host Manager, a web application used to manage Linux web servers. WHM often is included with CPanel, another web application used to give website owners control over their web servers. There are other DNS zone file editing tools for Microsoft, Unix, and other web servers. While tools may differ, record types do not change because they’re controlled by World Wide Web Consortium (W3C) standards.

The Web Host Manager interface is perhaps the simplest way for a non-technical person to edit their DNS zone file without destroying too much. WHM does generate error messages before writing an updated file. The arcane structure of a zone file is laid out nicely as a form that you can manipulate then save. To get to the zone file edit screen with WHM, find the “Edit DNS Zone” link near the bottom of the left navigation bar. Then select the domain name whose file you want to edit. The edit screen will appear as shown in this screen capture:


see this image full sized (120kb, 1024×768)

I have highlighted in pale yellow the fields that you would need to change/add to configure the address for a website and mail server.

In looking at this screen capture, note that all input data for record types must end with a period, for example, mail.yourdomain.com. and not mail.yourdomain.com, so that the DNS does not append data to that bit of information.

The minimum you need to configure a mail server is an MX record that points to mail.yourdomain.com and an A record that points to the internet (dotted IP) address for your in-house mail server. The other key record types (SOA, NS) should be pre-populated in the Web Host Manager form. Finally, on the SOA record, you should change the contact email address. Note that the contact email address uses periods instead of the @ symbol: fred.bedrock.com. instead of fred@bedrock.com (note the last period after .com. in the first example).

To check that your DNS zone file is configured properly, you can use a service like DNSReport. This free service checks your current zone file and reports back on a variety of issues with Pass, Warn, and Fail status for each issue. It tests your mail connection and lets you know if your MX and A record(s) are configured properly. If they’re not, you’ll get a red Fail status which means you need to go back to the Web Host Manager interface to fix the problem.

If you do not have access to Web Host Manager or similar tool, ask your webhosting vendor if they have a tool you can use. Otherwise, they have access to your DNS zone file and changes must be made through them. A domain registration service like Enom, however, does allow you to maintain part of your DNS zone file separate from your webhosting service (although you may need to work with your webhosting vendor to ensure the Enom and your webhosting zone files work together).

See? That didn’t hurt. For designers and programmers who provide internet capabilities to businesses, advanced technical support is not required to change a DNS zone file to point to their clients’ in-house email servers. In most cases, it is a minor configuration chore that you can handle or work with your webhosting vendor to configure.

Resources Mentioned in this Article

DNS Report http://www.dnsreport.com
Web Host Manager Website http://www.cpanel.net/
Enom Domain Registration http://www.enom.com

DNS Resources Directory http://www.dns.net/dnsrd/
Simple DNS Plus Help http://www.jhsoft.com/help/showtoc.asp?d=/help/rec_other.htm

Share/Save

Please leave a Reply

You must be logged in to post a comment.

Podcasts Worth a Listen

Boagworld

Get the Email Newsletter:
Stay Up To Date

Stories, links, and more emailed to you every few weeks!

PRIVACY NOTICE: Your email will never be sold or traded. Powered by Campaign Monitor.

About This Website

This site is an online magazine that offers free how-to internet knowledge for budget-minded businesses and the designers, programmers, and others who support them. Learn More...

Masthead

Writer, Editor, Publisher: Tim Slavin
Tel: (602)325-3024 (US)

AIM: redhorsecomm
Est. November 2002
skype.gif (get Skype for free)

Feeds

RSS 2.0
Atom