To "host your own domain":
- You need to first purchase a domain from a domain registrar. It sounds like you've done this.
- You need -- somewhere on the internet -- nameservers that are responsible for mapping hostnames (like
www.mydomain.com) to ip addresses. Many registrars provide DNS services for free. There are also some free third-party DNS servers, although in this you get what you pay for. There are a variety of high-quality, low cost dns hosting companies that you could investigate. You could of course also run your own nameservers (using
bind or some other dns software), but as you have noticed most registrars want you to have more than a single nameserver. You could work out an arrangement with a friend to cross-host your domains,
- If you want to host a website, you need to install and configure a webserver, and it sounds like you've already got that working.
So other than getting some nameservers provisioned you're all set.
To "host email for your domain":
- You need (well, should) establish MX records in DNS that indicate what servers are responsible for handling mail for your domain. You can actually get away without this if your domain has an
A record, but it's good form (and offers you flexibility you wouldn't otherwise have). The
MX record points to a hostname which must also be available in DNS.
- On the host pointed to by your
MX record, you need to run some sort of "MTA" (mail transfer agent), like Postfix or Sendmail or Exim or something. I use Postfix.
- If you want to be able to access email via POP or IMAP (as opposed to simply forwarding it elsewhere), you would also need to install something like Dovecot or Courier or Cyrus IMAPD to provide the POP/IMAP service.
If you're concerned about security, you'll want to configure all of your email-related services to support SSL, and you'll want your MTA to require authentication for outbound email (if you plan on using it for outbound mail).
For what it's worth: while I host my own MX server, I don't actually receive any email there -- it just forwards mail to other accounts (mostly Gmail these days, but also elsewhere).
There's lots of good documentation there on how to set things up. If you have questions about specific problems, posting to superuser or the unix/linux sites is probably a good place to start.