🌐 Domain Name System (DNS)

AP Computer Science Principles – Class Notes

1. What is DNS?

The Domain Name System (DNS) is the system that translates human-readable website names into IP addresses that computers use to locate each other on the Internet.

Humans prefer names like www.google.com, but computers communicate using IP addresses like 142.250.190.78.

DNS acts like the phonebook of the Internet by converting domain names into IP addresses.

2. Why DNS is Important

Without DNS, users would need to remember the numeric IP address of every website they want to visit.

Instead of typing 142.250.190.78, you can type www.google.com. DNS automatically finds the correct IP address for you.

3. Simple DNS Example

When you enter www.example.com into your browser, the following happens:

  1. Your computer asks a DNS server for the IP address.
  2. The DNS server looks up the domain name.
  3. The DNS server returns the IP address.
  4. Your browser connects to that IP address.
  5. The website loads.

4. DNS Lookup Process (Simplified)

  1. User enters domain name
    www.amazon.com
  2. Browser checks local cache
    Your computer may already remember the IP.
  3. Request sent to DNS Resolver
    Usually your ISP's DNS server.
  4. DNS server finds the address
    It may ask other DNS servers if needed.
  5. IP address returned
    amazon.com → 205.251.242.103
  6. Browser connects to the server
    The website loads.

5. DNS Hierarchy (How DNS Servers Work)

DNS is distributed, meaning it uses many servers across the Internet.

Root DNS Servers

Top-Level Domain (TLD) Servers

Authoritative Name Servers

Root Servers

The root DNS servers are the starting point of DNS lookup. They direct queries to the correct Top-Level Domain (TLD) servers.

Examples of TLDs include .com, .org, .net, .edu, and .gov.

Top-Level Domain Servers

These servers manage domains ending in extensions such as .com, .org, .net, and .edu.

Authoritative Name Servers

These servers contain the actual IP address records for a domain.

example.com → 93.184.216.34

6. DNS Records

DNS servers store information in DNS records.

Record Type Purpose
A Record Maps a domain to an IPv4 address
AAAA Record Maps a domain to an IPv6 address
CNAME Alias of another domain
MX Record Mail server for a domain
NS Record Name server for the domain
A Record:
example.com → 93.184.216.34

7. DNS Caching

To make the Internet faster, DNS results are cached, which means they are stored temporarily.

Caching can happen in:

Benefits of caching:

8. DNS and Reliability

DNS is designed to be:

9. DNS and Cybersecurity

DNS can also be involved in cyber attacks.

Attack Description
DNS Spoofing Fake DNS response redirects users to the wrong site
DNS Cache Poisoning Corrupts stored DNS data
DNS Amplification Attack Uses DNS servers in DDoS attacks

A major security improvement is DNSSEC (DNS Security Extensions), which helps verify that DNS responses are authentic.

10. Key Vocabulary

Term Definition
DNS System that converts domain names into IP addresses
Domain Name Human-readable website name
IP Address Numeric address used by computers
DNS Server Computer that stores domain records
DNS Lookup Process of finding an IP address from a domain name
DNS Cache Temporary storage of DNS results

11. Real-World Analogy

DNS works like a phone contact list.

Human Action Internet Equivalent
Look up a friend's name Type a domain name
Find their phone number DNS finds the IP address
Call the number Browser connects to the server
AP CSP Exam Tip: DNS translates domain names into IP addresses so devices can communicate on the Internet.

12. What You Should Remember