You are signed in. Close

You are signed out. Close

Thank you. Your subscription has started. Close

Thank you. You will get an email when a new comic comes out. Close

We could not confirm your payment. If you paid, use the link "Sign in" at the bottom of the page. Close

Something went wrong on our side. Please try again in a moment. Close

Previous episode SMTP: how an email travels from mail server to mail server

How email works: why a fake email from your boss can reach your inbox

MX records: how an email finds the mail server of a domain

An email address holds no place, only a name after the @. So how does an email find the one computer that takes the mail for that name?

  1. 1 An email address has two halves. After the @ comes the domain: the name of the place that takes the email. Before it comes the mailbox at that place, yours.you@woodshop.examplethe mailboxthe domain

    An email address has two halves. After the @ comes the domain: the name of the place that takes the email. Before it comes the mailbox at that place, yours.

  2. 2 So Rono's server asks DNS, the system the internet uses to look up names. Your phone asks it too when you type a web address, but this question is a different one: who takes the mail for woodshop.example?Who takes the mailfor woodshop.example?Rono'smail serverDNS

    So Rono's server asks DNS, the system the internet uses to look up names. Your phone asks it too when you type a web address, but this question is a different one: who takes the mail for woodshop.example?

  3. 3 The answer is an MX record, short for mail exchanger. The workshop published it in DNS, and it names the server that takes the workshop's mail. One more question gives that server's IP address, its number on the internet.DNSwoodshop.exampleMXmail.woodshop.examplemail.woodshop.exampleIP address198.51.100.25example number

    The answer is an MX record, short for mail exchanger. The workshop published it in DNS, and it names the server that takes the workshop's mail. One more question gives that server's IP address, its number on the internet.

  4. 4 Rono's server connects, and the workshop's server lets it in at once, with no password. It takes email from any server on the internet. It has to: anyone in the world may write to the workshop.Rono'smail serverthe workshop'smail serverCome in!

    Rono's server connects, and the workshop's server lets it in at once, with no password. It takes email from any server on the internet. It has to: anyone in the world may write to the workshop.

  5. 5 It reads the From line, finds Miva's own address, and has no reason to doubt it. Into your mailbox the email goes, with the real emails of the day.the workshop'smail serverFrom: miva@woodshop.exampleSubject: Pay the oak supplier todayyour mailbox

    It reads the From line, finds Miva's own address, and has no reason to doubt it. Into your mailbox the email goes, with the real emails of the day.

  6. 6 The workshop's server knows one thing for sure: the IP address of the server that is talking to it. It does not know which servers really send the workshop's email, so a fake of your own boss walks straight in. Can anything stop it?Rono'smail server203.0.113.66example numberthe workshop'smail serverIs this serverallowed to sendfor the workshop?

    The workshop's server knows one thing for sure: the IP address of the server that is talking to it. It does not know which servers really send the workshop's email, so a fake of your own boss walks straight in. Can anything stop it?

  7. Quick check

    Quick check.You send an emailto sam@gardenclub.example.What does your mailserver ask DNS?

    Quick check.

    Show the answer

    Who takes the mail for gardenclub.example: the MX record of the domain after the @. Sam's part is not in the question: the club's server finds Sam's mailbox itself.

  8. Go further

    One more thing about MX records.a backup mail servera domain can have morethan one MX record, each witha number that says whichserver to try first

    One more thing about MX records.

Next episode SPF records: how a mail server knows which servers may send for a domain

Share this comic

More comics