AWS Cloud Architect & Developer · Computer Networks
DNS, HTTP and Mail
DNS resolution and records, HTTP/HTTPS, well-known ports, and the SMTP send versus POP3/IMAP pull split.
The tap was a name, not a number. This lesson is what the phone asked for: DNS walks root → TLD → authoritative to turn shop.rao.example into 203.0.113.10, then HTTP over TLS on port 443 fetches /tea. Ports, cookies, and the mail send/pull split sit beside that fetch. Routing is the previous lesson — not this one.
- AWS Cloud Architect & Developer
- Medium level
- 5 concepts
- 4 practice questions
1DNS hierarchy and resolution
Meera typed shop.rao.example, not 203.0.113.10. DNS, the Domain Name System, is the phonebook that turns that human name into an IP address. A resolver — the lookup helper on the phone or at the ISP — walks a hierarchy. Root name servers know who owns each TLD (top-level domain) such as .example. The TLD servers know who is authoritative for rao.example. The authoritative servers for that zone return the address for shop.rao.example.
The common path is UDP port 53: a short question and a short answer, no TCP handshake. If the answer is too large, DNS can fall back to TCP. Port 53 is the well-known port — the agreed number for this program — not a layer.
Figure. Resolver walks root → TLD → authoritative. Solid edges are referrals down the hierarchy; dashed edges are the resolver's successive queries.
How a lookup walks
- Ask the rootThe resolver starts at a root server and learns which servers own the TLD.
- Ask the TLDThe TLD server returns the authoritative name servers for the domain.
- Ask authoritativeThe authoritative server returns the record (typically an A or AAAA address).
A typical DNS name lookup from a stub resolver runs mainly over
- TCP port 80
- UDP port 53
- UDP port 443
DNS queries are mainly UDP on well-known port 53. Port 80 is HTTP; 443 is HTTPS.
2DNS record types
The answer the resolver wants for the tea page is an A record: name → IPv4 address. shop.rao.example has A 203.0.113.10. AAAA is the IPv6 twin. MX names a mail server for the domain. CNAME is an alias: this name is another name, look again. NS names the authoritative servers for a zone.
The tea fetch uses A (or AAAA). Mail uses MX. The type is part of the question, not a second phonebook.
Figure. DNS answers differ by type: address, delegation, alias, or mail exchanger — match the question's needed record.
| Type | Maps name to | Typical stem cue |
|---|---|---|
| A | IPv4 address | Host address / IPv4 |
| AAAA | IPv6 address | IPv6 |
| MX | Mail exchanger host | Email delivery / mail server |
| CNAME | Another domain name | Alias / canonical name |
| NS | Authoritative name server | Who owns the zone |
Which DNS record type maps a domain name to an IPv4 address?
- MX
- A
- CNAME
A is IPv4 address. MX is mail exchanger; CNAME is an alias to another name.
3HTTP, cookies, and HTTPS
After DNS, the phone has 203.0.113.10 and opens TCP to port 443. HTTP is the application protocol for the web: the phone sends a request, the shop sends a response. Stateless means the shop does not remember Meera from the last request unless something extra carries memory. A cookie is a small token the shop sets and the phone sends back on the next request. HTTPS is HTTP over TLS — Transport Layer Security, the encryption wrapper — on port 443. The URL's https is that wrapper, not a different page language.
Plain HTTP on port 80 is the same request/response without TLS. Status 4xx means the phone's request was wrong (404: no /tea). Status 5xx means the shop failed a valid request. TLS encrypts; it does not by itself create login memory.
Figure. HTTPS is HTTP over a TLS session; HTTP itself stays request/response and stateless at the application layer.
How to read an HTTP stem
- Stateless defaultPlain HTTP remembers nothing between requests by itself.
- Add memoryCookies/sessions carry client state the server can recognise next time.
- EncryptHTTPS on 443 wraps the same HTTP messages in TLS.
| Method | Intent |
|---|---|
| GET | Read / retrieve |
| POST | Submit / create |
| PUT | Replace / update |
| DELETE | Remove |
HTTP itself is described as stateless. What usually adds memory across requests in a web app?
- Switching from GET to PUT
- Cookies or sessions on top of HTTP
- Using port 80 instead of 443
HTTP does not keep per-client memory between requests. Cookies/sessions add that state. Port choice and method choice do not make the protocol stateful by themselves.
4Well-known application ports
A well-known port is an agreed number so the phone knows which program to ask for. The tea page used TCP 443 (HTTPS). The name lookup used UDP 53 (DNS). Mail send is SMTP on TCP 25. Mail pull is POP3 on 110 or IMAP on 143. FTP uses 21 for control and 20 for data.
The port is not the protocol's 'layer number.' It is the door on one machine. TCP versus UDP is the transport choice; 53 versus 443 is which program.
Well-known ports are a lookup: 20/21 FTP, 22 SSH, 25 SMTP, 53 DNS, 80 HTTP, 443 HTTPS, and friends. The seven-row table is the content; a strip of numbered boxes would only restates those integers.
| Protocol | Port | Role |
|---|---|---|
| DNS | 53 | Name resolution (mainly UDP) |
| HTTP | 80 | Web request/response |
| HTTPS | 443 | HTTP over TLS |
| FTP | 20 / 21 | Data / control |
| SMTP | 25 | Send mail |
| POP3 | 110 | Retrieve mail |
| IMAP | 143 | Retrieve mail (server-side folders) |
Which application protocol uses well-known port 443?
- HTTP
- HTTPS
- FTP control
443 is HTTPS (HTTP over TLS). HTTP is 80; FTP control is 21.
5Email: SMTP push, POP3/IMAP pull
If the shop later emails Meera a receipt, that is a different application path. SMTP, Simple Mail Transfer Protocol, pushes the message toward a mail server — send. POP3 or IMAP later pulls the message to her phone — retrieve. SMTP does not download the inbox. IMAP does not deliver the outbound receipt.
Keep the doors straight: SMTP 25 sends; POP3 110 and IMAP 143 retrieve. The tea page never used these ports. They are here so 'application layer' is not only HTTP.
Figure. SMTP pushes mail toward the mailbox; IMAP/POP pull it to the reader — opposite directions, different protocols.
How to classify the stem
- Sending?Server-to-server or client submission of outbound mail → SMTP.
- Retrieving?Client fetching from the mailbox → POP3 or IMAP.
- Don't swap ports25 is send; 110/143 are retrieve — not interchangeable labels.
| Protocol | Direction | Port |
|---|---|---|
| SMTP | Push (send) | 25 |
| POP3 | Pull (retrieve) | 110 |
| IMAP | Pull (retrieve) | 143 |
A mail client needs to upload an outbound message to its mail server for delivery. Which protocol fits?
- POP3
- IMAP
- SMTP
SMTP pushes mail toward the server for delivery. POP3 and IMAP retrieve messages from the mailbox.
Notes
- DNS resolves domain names to IP addresses using a hierarchy (root -> TLD -> authoritative) and runs mainly over UDP port 53.
- HTTP (port 80) is stateless request/response; cookies add state; HTTPS (port 443) adds TLS encryption. FTP uses ports 20 (data) and 21 (control).
- Distance Vector routing (Bellman-Ford, e.g. RIP) shares its whole routing table with neighbors and can suffer the count-to-infinity problem.
- Link State routing (Dijkstra, e.g. OSPF) floods link states so each router builds a full topology map and computes shortest paths.
- Email uses SMTP (port 25) to send, and POP3 (110) or IMAP (143) to retrieve messages from the mail server.
Formulas
- Well-known ports: DNS=53, HTTP=80, HTTPS=443, FTP=20/21, SMTP=25, POP3=110, IMAP=143.
- Distance Vector update: D_x(y) = \min_v \{ c(x,v) + D_v(y) \} (Bellman-Ford equation).
- Link State uses Dijkstra's algorithm with complexity O(E \log V) using a priority queue.
- Count-to-infinity is mitigated by split horizon and poison reverse in distance vector.
- DNS record types: A (IPv4), AAAA (IPv6), MX (mail), CNAME (alias), NS (name server).
Exam traps & shortcuts
- Distance Vector = 'tell neighbors everything about the world'; Link State = 'tell the world about your neighbors'.
- HTTP is stateless — cookies/sessions are what add memory across requests.
- SMTP pushes mail to the server; POP3/IMAP pull it to the client.
Recap
The tap was a name. DNS found the number; HTTP fetched the page.
- DNS
- Root → TLD → authoritative. Common path UDP/53. A record: shop.rao.example → 203.0.113.10.
- HTTP
- Stateless request/response. Cookies add memory. HTTPS is HTTP over TLS on 443.
- Ports
- 443 HTTPS, 53 DNS, 25 SMTP send, 110/143 pull. A port is a door, not a layer.
- SMTP pushes outbound mail. POP3/IMAP pull the inbox.
Practise DNS, HTTP and Mail
Reading is free and needs no account. Practice, mocks and progress live in the app.
- 4 exam-style questions on this topic, with explanations
- A 3-question practice set that ends the chapter
- Timed mocks scored with the real marking scheme
- Readiness tracked per topic, kept on your device