DNS and email
- DNS
- electronic mail:
- addressing
- format
- content encoding: MIME
- Simple Mail Transfer Protocol, SMTP
- access: POP, IMAP
Domain Name System
- www.ics.hawaii.edu, maru.ics.hawaii.edu, www.ibm.com
- hierarchical name space:
- top-level domains: .com, .edu, .gov, .mil, and all two-letter
country prefixes
- second-level domains: yahoo.com, hawaii.edu, stanford.edu
- third-level domains: ...
- each name at each level may or may not correspond to an actual IP address
- each name at each level may or may not be further subdivided into
lower-level domains
- the same component (e.g., www) can be used within different DNS names
In-Class Exercise
- whole class jointly
- name as many top-level domains as possible
DNS Protocol
- each DNS name corresponds to a Resource Record
- "A" RRs provide name to IP translations
- DNS servers are configured to serve (part of) a DNS (sub)tree:
a zone
- each zone has at least 2 DNS servers
- example: hawaii.edu is a zone, ics.hawaii.edu could be another zone
- servers may also cache information outside their zone, and forward it,
but they are not authoritative about that information
DNS Lookup
- host requests translation (over TCP or UDP)
- server can:
- provide translation from its authoritative data
- provide translation from its cache
- forward the request to another server closer to the destination (in
one of its neighboring zones)
- provide the address of another server closer to the destination
- a client can try different suffixes if the name itself doesn't work
(e.g. .ics.hawaii.edu or .hawaii.edu)
Comparison of DNS and IP hierarchies
- often, the IP and DNS hierarchies match with the administrative
structures,
e.g. ICS has ics.hawaii.edu and the
128.171.20.0/24 subnets, under hawaii.edu and 128.171.0.0/16
- but this doesn't have to be the case:
- an IP that belongs to UH (128.171.X.Y) could have
a different DNS name
- a DNS name ending in .hawaii.edu need not have a UH IP
address
- one IP address can have many different domain names, e.g.
www.ics.hawaii.edu and
iwi.ics.hawaii.edu are both 128.171.10.250
- www.rcuh.com at 207.175.158.132
User-level NS translations
- nslookup name gives us the translation, main name, and aliases
(available on uhunix)
- forward and reverse translation
- nslookup gives access to different resource records,
can be aimed at different servers, etc
- also dig -x dns or dig -x ip (linux, unix?, win?)
- DNS is case-independent
Electronic Mail
- originally, distributing text to local computer users ("memos")
- evolved to transferring to users on other computers
- terminology of paper mail: to, from, cc
- an address uniquely identifies a user (before the @ sign), and
a computer (after the @ sign)
- the user name is assigned locally
- the computer name is assigned according to DNS (hierarchically)
Electronic Mail Format
- an electronic mail message has a header followed by
a blank line, followed by an arbitrary body
- the header has entries, one per line
- each entry has the field name, followed by a colon (":"),
followed by the field value
- what other protocol does this resemble?
- there is no content length: the length is given by the
length of the file or of the transfer
- header fields (case independent) include To, From, Cc
- mailers generally ignore header fields they don't understand
Multipurpose Internet Mail Extension
- ASCII body is fine for text, not for graphics or audio
- there is no single standard for video/audio, nor
for non-ASCII (non-English) text
- MIME is an extension that adds a few header field (upward and
downward compatible) and allows sending of arbitrary types
- the contents should still be ASCII (characters in the range 32 to 127)
- MIME-Version: 1.0 header field is followed by
Content-Type: ..., which
can be Multipart to have multiple attachments
- plain text often precedes the first attachment
Electronic Mail Transfer
- SMTP: simple mail transfer protocol, port 25
- mail generated by a mail client
- mail client transfers the message to a mail agent on the same
machine (mail transfer program)
- mail agent contacts the mail server (or mail agent) on the
remote machine to deliver the message
- user uses mail client to access email stored locally
- many mail agents will forward email from any machine, not just the
local host, or may expand a mailing list or convert an external to an
internal address
POP, IMAP
- Post Office Protocol, POP
- POP server runs on computer with mailbox
- user contacts POP server, authenticates, retrieves mail
- POP-2 and POP-3 are newer, more secure, better versions
- Internet Message Access Protocol, IMAP
- same model as POP, but more flexibility:
- client can request a message without deleting it from the server
- client can request only the headers
- allows email access from many different computers