Domain Name System
NOTES
- Domain names were created to convert the numeric IP address to a simple recognizable name
- Fully qualified domain names are much easier for people to remember than an IP address
/NOTES
- communicate with others on the internet without needing to remember their IP addresses
Hierarchy
Top-Level (.com,.org,et cetera)
rightmost part of a domain name
-
g(eneric)TLD->.gov
-
c(ountry)c(ode)TLD-> .in
Second-Level Domain(google, facebook, github)
- <63 characters
- a-z, 0-9, - (cannot start or end w/ hypen and no consecutive hyphens)
Subdomain(help(.SLD.TLD))
- To the left of the SLD
- No limit on the number of subdomains for a given domain
- must respect maximum length constraints
Record Types
-
A
resolves to IPv4 address
-
AAAA
resolves to IPv6 addresses
-
CNAME
resolve to another domain name
-
MX
Mail Exchanger/mailservers
-
TXT
text field, used to verify ownership of domain too
Steps of a DNS request
-
The local cache is checked, if not found, the request will be made the the DNS server
On Microsoft Windows, you would run
ipconfig /flushdns
to clear the cache -
the recursive DNS server checks its cache for a record, if not found, it queries the internet’s root DNS servers
For the difference between recursive and authoritative DNS servers, click here
-
the root server will redirect you to the appropriate TLD server
-
the TLD server will have records for the authoritative DNS servers(nameservers) with the record
-
depending on the record type, it is sent back to the recursive server, where it will be cached and sent to the requester
Using nslookup
nslookup [--type=RECORDTYPE] [server]
RECORDTYPE to use the default nameserver to perform a query for a certain type of record
WIP