Proper External DNS Configuration
Introduction
DNS can be a confusing subject for many. In fact, in my travels as a consultant I have found that DNS is by far the most mis-configured service of any, in the entire infrastructure. By the time you finish reading this, I hope you will have gained enough knowledge to properly configure external DNS for your web site, email server and other services.
How it works
Let’s begin by talking about what DNS is and its role in the operation of the Internet. When you enter www.yahoo.com in your web browser, the very first thing your browser does is convert it into an IP address. How does it do this? It performs a DNS query, asking the nearest DNS server for the IP address of yahoo.com.
DNS uses a small database. Inside that database, are records for each domain name contained on that server. Common types of DNS records include: A, NS and MX. When the DNS server is queried for the IP address of yahoo.com, it looks for the A record, and returns the IP address to the original requester.
The A Record
As mentioned before, the A record stores the IP address of a domain name. As you can see in the figure below, hobbycode’s IP address is 209.59.150.82.

Your domain name will look much like hobbycode’s, if your ISP or web host, hosts all of the functions of your network. But what happens when you want to begin hosting your own email server?
The MX Record
Short for Mail Exchanger, the MX record is responsible for pointing to the IP address of your email server. Earlier I stated that your browser will query a DNS server’s A record for a website you just entered, a mail server will query a DNS server for it’s MX record to determine where to send the email.
Now that you’ve decided to host your own email server, you should contact your DNS host and ask them to change the MX record to point to the IP address of your network. This is often the external IP address of your router, and is assigned to you by your ISP when you account is setup. You should also ensure that your ISP assigned you a static IP address. It would be a huge burden to have to manually update your DNS records when your IP changes!
MX Pointing to an A Record
So now you’re up and running on your own mail server, sending and receiving all day long. Your users request access to webmail. If you’re using Microsoft Exchange Server, I’m referring to Outlook Web Access. The only way to access your server is to type in the IP address into your browser. But the whole goal of DNS is to avoid this. Lucky for you, a simple DNS change can remedy this!.
First off, create an A record which points to your external IP address. Name it something your users will remember. The most common name is simply "mail".
Second, change your MX record from the IP address, and point it to mail.<yourdomain>.com, which is the A record you just created.
So, if your external IP address is 1.2.3.4, then:
| Record Type | Name | Value |
| A | mail.<yourdomain.com> | 1.2.3.4 |
| MX | <Yourdomain.com> | mail.<yourdomain.com> |
Lastly, tell your users to go to http://mail.<yourdomain.com>.
Summary
DNS is not a difficult subject to master, but can be very confusing as it’s not something the average network administrator works with on a daily basis.