Application Layer III Flashcards
(13 cards)
Hostnames vs IP Addresses
IP address - a unique identifier of a host(name) -preferred by machines
host name - a human readable name
gethostbyname() is the name of the library call (in C, Python, etc.) to
lookup an IP address for a given hostname
In Python: hostIP = socket.gethostbyname(“google.co.uk”)
* Communicates with the local DNS resolver of the system
What is a Domain Name?
Domain name example:
example.com
A domain name is a broader identifier that allows organisation
names and hostnames. It is a hierarchical name that follows an organisational structure .
examples are:
map www.networkutopia.com (hostname)
Run an email service: mail.networkutopia.com
DNS: Design Objectives I
Efficiency: Name resolution must occur quickly - You can’t visit a website like Google until your device quickly finds out its IP address
Scalability: DNS must be designed to handle large volumes of
traffic effectively, ensuring it can scale to meet demand
Resilience: DNS must maintain high availability
Security: Name resolution must be secure – DNS must return the
correct IP address for a given name
Ownership and Control: Domain name owners should have the authority to manage the hostname-to-IP mapping of their names:
– Update hostname-to-IP mappings when necessary
– Deploy other services by defining additional “sub-names”, i.e.,
subdomains:
* e.g., mail.networkutopia.com for an email service
Domain name system definition
It translates website names (like google.com) into IP addresses (like 142.250.190.14) that computers use to find each other.
DNS: Design Objectives III
Governance of the namespace: There needs to be control over
domain ownership and registration:– No one should be able to steal or claim ownership of an existing
name
– Need control over who can be the rightful owner of a name
- Registered trademarks are controlled by their rightful owner:
* E.g., “Coca-Cola” name is owned only by the Coca-Cola Company who
can use that name in their registrations.
coca-cola.com - domain
coca cola -> chosen by owner and is the second level domain
Sub domain
If one domain’s name ends with another domain’s name, it’s a subdomain.
DNS servers
Would a centralised (one server for every dns) database in a single server work?
– Not resilient
– it would be a single point of failure
– Not scalable
– Won’t be able to deal with the large traffic
volumes
– Difficult to maintain on a single server
– a huge database that
needs updating frequently
* DNS should obviously be designed as a distributed database
– How should the records be distributed across “name servers”?
example:
Client wants IP for www.amazon.com
umass.edu
DNS servers
; 1st approximation:
– Client queries root server to find .com DNS server
– Client queries .com DNS server to get amazon.com DNS server
– Client queries amazon.com DNS server to get IP address for
www.amazon.com
The ’13’ Root Servers
- Updated twice a day from non-public
registry file server* - Each server has a redundant backup
- They are also replicated across the globe
– Many more than 13 physical machines!
– Clients access closest servers
– Addresses for one of each server hard-coded
into resolvers etc.
Top-level domain (TLD) servers:– Responsible for com, org, net, edu, aero, jobs, museums, and all
top-level country domains, e.g.: uk, fr, ca, jp
Local DNS name server
Does not strictly belong to hierarchy
Each ISP (residential ISP, company, university) has one– Also called “default name server
When host makes DNS query, query is sent to its local DNS
server
Recursive query in dns
When you type www.google.com into your browser:
Your computer asks the recursive DNS server:
“What is the IP address for www.google.com?”
That server doesn’t know the answer yet — so it:
Asks a root server
Then a .com server
Then the google.com server
It keeps asking until it gets the final IP address.
It returns the answer to your computer
iterative Query in DNS
When a DNS resolver (e.g. your local DNS server) wants to find www.google.com:
It asks a root DNS server:
“What’s the IP for www.google.com?”
The root server doesn’t know the final answer, but it replies:
“I don’t know, but try asking a .com server.”
Then, the resolver asks the .com server.
It replies:
“Ask the google.com server.”
Finally, it reaches google.com’s server and gets the IP
DNS: caching, updating records
Once (any) name server learns a mapping, it caches it
– Cache entries timeout (disappear) after some time (TTL)
– TLD server content is typically cached in local name servers
* Thus root name servers are not often visited
* But, cached entries may become out-of-date (best effort name
to-address translation!)
DNS records
type=A
, ttl)
▪ name is hostname
▪ value is IP address
type=CNAME
▪ name is an alias for some
“canonical” (the real) name
▪ e.g. www.lancaster.ac.uk
is really www.lancs.ac.uk
▪ value is canonical name
type=NS– name is domain (e.g.,
foo.com)
– value is hostname of
authoritative name
server for this domain
type=MX
▪ value is name of mail server associated with name