Quite a lot of questions but the main two ideas to have in mind:
- the DNS is a hierarchy, or a tree: technically each node works exactly the same way, wherever it is in the tree; for a node to be resolved it has to be connected to some parent node; this is done in the DNS with
- domain name registrar play no operational role during resolution (except if they are also DNS provider, but this is orthogonal); they are only use to provision and update domain names at the parent zone (the registry)
Now for your questions:
Say I register example.com. What's actually going on here?
You go to a registrar. The registrar will check with the registry is the domain is available. Then it will collect data and money from you and then send the name desired and data (contacts, etc.) to the relevant registry typically using EPP as protocol. The registry will then update its authoritative nameservers to add
NS records for your domain to point to the nameservers of your choice, so that the whole resolution works.
Is there some master list of servers somewhere that your registrar updates,
No, because the DNS is a tree. When you register
example.com, only the parent (
.com) needs to be updated. Each TLD is run by a different registry (to summarize) and registrars connect to it. Registrars do not update anything directly, this is a job for the registry
How does email@example.com actually work?
Anyone wanting to send an email to that address will at some point do a
MX query in the DNS to find out which servers are Mail eXchangers for this domain, that is host configured to accept emails. When found, using SMTP, the emails are sent to one of those hosts.
Who's in charge of managing that email
The owner of the domain and then transitively the DNS provider used to be authoritative for the domain and the email hoster that will get incoming emails, and probably provide mailboxes and access to them through a protocol like IMAP
and what if someone else buys example.com 5 years from now?
If a domain changes hand, be it after expiration and deletion or just a change of owners (domains are a liquidity, there is a second market), the new owner of the name has full authority to configure it in any way it wishes.
Could I host my own email address at home if I own a domain name
Yes, but that means you need to have a server always on, to be able to receive emails. Of course you need to configure it properly, secure it, make backups, have a static IP address (not 100% necessary but certainly far simpler) and make sure it is not listed as residential or blacklisted if you want to send emails from there, etc. etc.
and would I want to do that?
Probably not, until you understand fully how the DNS, SMTP and IMAP works for example. Otherwise it is nice to learn but certainly not for production. It is not cost effective either if you factor in the electricity, Internet bill, time you put into managing it, etc.