DNS Notes
DNS Notes in Cloud Computing Class
DNS
There’re two ways to identify a host — by a hostname and by a IP address. People prefer the more mnemonic hostname identifier, while routers prefer fixed-length, hierarchically structured IP addresses.
What is DNS
DNS, domain name system is the networking system that allows us to resolve human-friendly names to unique id addresses. DNS is a globally distributed, stateless, scalable, reliable database.
- a distributed database implemented in a hierarchy of DNS servers
- an application-layer protocol that allows the host to query the distributed database
- DNS protocol runs over UDP protocol and uses port 53
DNS components
- name space
- name servers
- resolvers
Name space
The name space is the structure of DNS database. It’s an inverted tree with the root node at the top. Each node has a label, the root node has a null label written as .
.
labels and domain names
A label is a string up to 63 bytes. A domain name is a sequence of labels from node to the root, separate by .
, read from left to right.
Domain names are limited to 255 characters in length.
Top-level domain, TLD, is the furthest portion to the right, the most general part of the domain.
- gTLD, generic top-level domain,
.com, .edu. .gov
… - ccTLD, country code,
.cn, .fr, .uk
…
Name servers
The domain name hierarchy exists only in abstract. It’s implemented by name servers.
- run the software (BIND, BIND 9, NSD) which receive and respond to DNS queries
- name servers store the information about name space in units called zone
- Usually, one or more name servers are authoritative for the same zone ensuring redundancy and load balancing
- A single name server may be authoritative for many zones
There’re two main types of name servers
- Authoritative — maintains the data
- Primary — where the data is edited
- Secondary — where the data is replicated
DNS recourse records types
Each name server implements the zone information in collection of recourse records. A recourse record is a 5-tuple contains the following fields: (Name, Value, Class, Type, TTL)
Type field specifies how the value should be interpreted
- A: IPv4 address
- AAAA: IPv6 address
- CAA: specify which certificate authorities (CAs) are allowed to issue certificates for a domain or subdomain
- CNAME: the same format as a domain name
- MX: a main exchanger, specify a mail server responsible for accepting emails on behalf of recipients’ domain
- NS: identify the name server for the hosted zone
- SOA: start of authority record, provides information about a domain and the corresponding zone
TTL, time to live, the amount of time, in seconds, that you want DNS recursive resolvers to cache information about this recourse record set.
Name resolution
Name resolution is the process by which resolvers and the name space servers cooperate to find data in the name space.
A DNS query has three parameters:
- A domain name
- A class (IN)
- A type (e.g., A)
Upon receiving a query from a resolver, a name server will
- look for answer in its authoritative data and cache
- if step 1 fails, the answer must be looked up
Read more
DNS Related Outages:
- What We Know About Friday’s Massive East Coast Internet Outage
- DDoS, distributed denial of service attack
References
- CSYE 6225, Tejas Parikh, Northeastern University
- https://www.cloudflare.com/learning/dns/what-is-dns/
- https://www.digitalocean.com/community/tutorials/an-introduction-to-dns-terminology-components-and-concepts
- https://www.ibm.com/topics/dns
- https://github.com/Habbie/hello-dns
- Computer Networks A Systems Approach (Larry L. Peterson, Bruce S. Davie)
- Computer Networking A Top-Down Approach (James Kurose & Keith Ross)