DNS Flashcards
If you parse a URL what are the different parts?
Schema: The shcme is the first part of the url and indicates the protocol. Ex: http, https.
Authority: includes domain name and optional port number. Ex: www.example.com
Path: The hierarchical structure of the resource’s location on the server. Ex: “/state/city.html”
Query: An optiona part of the url and contains additional information that the server can use. Ex: ?query=URL+parsing
Fragment Identifier: Direct the browser to a specific section or anchor within the resource. Ex: #section2
What is the motivation for DNS
It is hard to remember the exact IP of a website and it might change over time. A DNS therefore allows us to use familiar names instead of numerical ip addresses.
Goals of DNS
Scalabillity:
One of the primary goals of DNS is to handle a massive number of domain name records.
Distributed Control:
DNS was designed with a distributed control model. This means that the control over domain names and their associated records is delegated to the respective domain owners and administrators
Fault tolerance:
The failure of a single server should not affect the whole system
Minimized Lookup Failures:
DNS aims to minimize the likelihood of lookup failures, even in the presence of various network problems
Explain the concept of aggressive caching within the DNS
Given the read-mostly nature and the loose consistency of DNS. When the DNS resolves queries for a hostname-to-IP mapping the resolver caches the result. A cached lookup has a TTL before the cached memory is removed.
What does DNS stand for?
Domain name system
What is a zone in the DNS?
Each zone represents a portion of the domain namespace, and these zones are separately administered to allow for effective management and delegation of responsibilities.
What is the DNS architecture?
hierarchical and distributed
What is a recursive query?
When an application or client initiates a recursive query, it means the querying system expects a complete and final answer. This type of query is typically made to a local DNS server, often provided by the user’s ISP (Internet Service Provider), or a public DNS resolver like Google’s 8.8.8.8. The local DNS server takes on the responsibility of resolving the query by interacting with other DNS servers.
What is a non-recursive-query?
These queries are used by DNS servers to gather information from other DNS servers. When a local DNS server receives a recursive query from a client, it may need to contact multiple other DNS servers to find the IP address associated with the requested domain name. It does so using a series of non-recursive queries to authoritative DNS servers, which are responsible for the specific domain in question.
How does the DNS architecture operate?
An application initiates a recursive query to the local DNS server (1).
The local DNS server, acting as a resolver, queries the root DNS server for information about the requested domain (2). This query is typically non-recursive because the root server provides referrals to other DNS servers.
The root DNS server responds to the local server with a referral to the appropriate top-level domain (TLD) server responsible for the requested domain (3).
The local DNS server queries the TLD server for information about the domain (4). Again, this query is non-recursive, as the TLD server may provide referrals to authoritative DNS servers for the domain.
The TLD server responds to the local server with a referral to the authoritative DNS server for the domain (5).
The local DNS server finally queries the authoritative DNS server for the IP address of the domain (6). The authoritative server provides the IP address (A record) in its response.
The local DNS server caches the IP address and returns it to the client application (7). Subsequent queries for the same domain can be answered directly from the cache, reducing the need for further recursive queries.
Explain the DNS protocol
TCP / UDP Port: 53
Mos trafic uses UDP
Retries with TCP if UDP failes or the request is bigger than 512 bytes
Has a query bit that indicates with the querie is recursive or not
What is a RR
Resource Record
What is the information represented in a RR
Name - domain name
TTL - time to live in seconds
Class - DNS class
Type - type of record
rdata - data depending on the type of record
What are the most important DNS RR types?
A - Internet address
NS - name server
What IP protocol is most used for DNS traffic?
UDP (User Datagram Protocol)
Low overhead, efficient for quick and lightweight queries. The UDP protocol has a maximum message size of 512 bytes, which includes the DNS header and the data payload. This limit ensures that DNS queries and responses can be transmitted in a single UDP packet.
However, if the DNS query or response exceeds 512-byte limit of UDP it resorts to using TCP.