Web & e-mail hosting with linode.com and zoneedit.com

Intorduction

There have been a lot of questions lately in the linode forums about how to set up hosting using a linode and a domain you own. The whole process can be quite daunting to the uninitiated--it was for me once--and the help available on the web seems to assume a certain level of understanding. This document will hopefully help readers to understand what they need to do to get things running and at the same time explain some of the details so they can begin to understand what's going on a little better.

The Basics

Let's look at what you're trying to accomplish. You want e-mail and web services for yourdomain.com to be hosted on your linode. Without delving into the nitty-gritty of protocols, suffice it to say that when an e-mail is sent to user@yourdomain.com or when someone types http://www.yourdomain.com/ into their browser the software they are using finds out what IP address is associated with those names and then send/retrieves information as necessary. To get this working you'll need to have DNS, e-mail and web servers configured correctly.

Overview

There has been some confusion about what each of the parties actually does, so here's a quick synopsis:
Here's a rough overview of how the process works:
  1. You provide your registrar information about your domain: Techincal contact, Administrative contact, DNS servers etc.
  2. Your registrar tells the root DNS servers which servers hold DNS information for you domain.
  3. When a client needs to find the IP address for www.yourdomain.com their computer sends a request to their DNS server.
  4. If the client's DNS server has a response cached, it send it to the client. (Skip to step 10)
  5. If not, the client's DNS server asks the root DNS server about yourdomain.com.
  6. The root DNS servers respond by telling the client's DNS servers to ask the servers you told your registrar about (your DNS provider's servers).
  7. The client's DNS server then asks your DNS provider's servers about www.yourdomain.com.
  8. Your DNS provider's servers respond with the IP address.
  9. The client's DNS server caches this information then sends a response to the client's computer.
  10. The client's computer then connects to that IP address and requests the appropriate web-page.
So, we can see that there are a few pieces of the puzzle that need to be put together before things will work correctly. The next three parts explain each of the pieces in more detail. The order they're presented in is the most logical, but you could do them in any order really.

Part 1 - DNS Configuration

Since you have a linode, that's the perfect place to host e-mail and web services, but DNS can be difficult to set up and a real pain to administer. The zone files are cryptic and actually getting everything configured correctly is like trying to convince Marvin the Paranoid Android that life is beautiful. To lessen the headache, we're going to use a DNS hosting service. My favorite--because it's free--is ZoneEdit. You'll need to go to their signup page and register for an account. I've been using them for a while now and have never had a problem. A word of caution: Use an e-mail address that is not @yourdomain.com for the signup. Otherwise you'll have a serious chicken and egg problem later!!! Fill out your information and select the "Free Trial" option at the bottom of the page. They will e-mail your password to you. This is one reason we don't use an @yourdomain.com address.

When you get your password, go to their login page and log in to your account. The first order of business is to add your new domain. Click on the "Add Zones" link--don't worry about the bulk loader part, just put yourdomain.com into the textbox at the top and click the "Add Zone" button. I think it asks you to confirm at this point, but I don't remember. If someone actually goes through all of the instructions and gets details, send them to me and I'll add them. Now it's time to set up the records we need. Click on the "Edit Zone" link at the top and then the "yourdomain.com" link. This should give you a screen showing how yourdomain.com is currently set up. This is probably blank except for "Nameservers" at the bottom. Make a note of these for later. Click "IP Addresses" and enter your linode's IP into the "Numeric IP" textbox. Leave "Name" blank and click "Add New IP Address". ZoneEdit ask if you want to add www.yourdomain.com and yourdomain.com or just yourdomain.com. Add both. With DNS set up this way everything should work, but just to be sure, we'll add a record for the mail server. Go back to the main page for the domain and click "Mail Servers". Enter www.yourdomain.com into "Mail Server" and yourdomain.com into "Mail Destination" and click "Change". Congratulations, ZoneEdit is now configured to answer DNS queries for yourdomain.com.

Part 2 - Linode Configuration

On your linode, you need to set up a Mail Transfer Agent (MTA) listening on port 25 and a web server listening on port 80. In all likelyhood, this is set up already. You will need to configure your MTA to accept mail for mydomain.com, but that is dependent on your MTA. Check the docs and the web, especially TLDP--their HOWTOs are great. As for your web server, if you're only hosting one domain, you just need to dump your files into the web server's root. Again, this is beyond the scope of this document (for now--but its /var/www/html/ on RedHat). Once your server is configured, it's time to point traffic. Also, open a support ticket and ask to have your IP reverse to www.yourdomain.com so that reverse lookup work as well.

Part 3 - Registrar configuration

This is easy. Remember when I told you to make a note of the name servers? Log into your account at your registrar and configure your DNS entries to point to the zoneedit.com servers. This change takes time to propogate through the Internet. Your domain record should be pointing to zoneedit.com within 24 hours or so, but any caching nameservers that have looked up your domain recently won't know this until their cache expires. Its frustrating to have to wait for changes to propogate, but such is the nature of the Internet. If there's nothing at you domain at the monent its just a waiting game. If there is, it's a hope for the best game.

Congratulations, you're all set up

OK, maybe not. If you don't understand something or want more information, e-mail me and I'll try and help. I'll add sections to this document as time goes on.

E-mail addresses in this document should be considered voltile. If they start getting spammed they will be changed and the old address shut off. Any changes will be reflected here.
If you're reading a copy of this document, the original can be found here

© 2003 James Sinclair -- Permission is granted to copy and redistribute this document in any form as long as it retains my copyright and a reference back to the original documents address on the web.