Networking 5 Flashcards
Domain Name System (DNS)
DNS is responsible for translating a domain name, such as ‘google.com’, into an IP address which computers can understand.
Every computer must have a DNS server configured in their network settings.
Your router, in turn, will use DHCP (Dynamic Host Configuration Protocol) to tell every computer on your network to use that DNS server.
Once you type a domain name into your browser, your computer will send a request to the DNS server in your network settings for that domain, and your DNS server will give your browser the matching IP address.
Top Level Domain (TLD)
The DNS system is hierarchical; no one server has all the answers about every domain on the internet.
The system relies on one server giving more information on the next DNS server to query, all the way down to the name server which does know the answer for that specific domain. This makes for a robust system which can deal with outages without bringing the entire internet down.
The TLD indicates which DNS server to query first, so if you do a DNS lookup for google.com, you will query the name server(s) for ‘com’ first. That name server won’t know the IP address for ‘google.com’, but it will know which name server you can ask to get your answer.
Authoritative Name Servers (ANS)
A name server that is authoritative for a domain is one that controls the mapping between the domain name and the IP address.
Caching
If a name server makes a query and discovers the IP address a domain points to, it can cache the result for a time. Future requests for that domain will use the saved value, to save from the name server having to make the request every time.
Of course, it will still periodically erase the cache so that if the name server configuration is updated, it will reflect the new address in a reasonable time, but caching provides a measure of efficiency so that not every request to a domain has to be sent to the authoritative name server each and every time.
Forward & Reverse Lookups
Forward Lookup: translating a domain name into an IP address.
Reverse Lookup: translating an IP address into a domain name.
A reverse lookup is something of an oddity because there is no authoritative name server for IP addresses.
The way we get around that is by converting the IP address to a domain name in the format: 1.0.168.192.in-addr.arpa. By performing a DNS query on this domain, we can look up any domains which are linked to that IP address.
Each domain must have reverse DNS configured by adding a particular DNS pointer record to the authoritative name server.
Recursive & Iterative Lookups
With a recursive lookup, you ask the DNS server a question and if the DNS server doesn’t know, it will ask another DNS server and so on until it has the answer and then it will pass on the answer to you. This method is not commonly seen anymore because it uses up a lot more server resources than the alternative.
With an iterative lookup, you ask a DNS server a question. If it doesn’t know the answer, it will respond with the IP address of a DNS server that does know. It is then your responsibility to ask the next DNS server in line the question, and then it will either answer or send you to yet another DNS server to ask the question. This places more of a burden on the host asking the question, but it is much easier on the DNS servers.
DNS Records
When you are configuring the authoritative DNS server for a particular domain, you will need to add DNS records for that domain.
A Record
The A record is the ‘Address Mapping’ record. This is the key record that maps a domain name to an IPv4 address.
AAAA Record
The AAAA record is the ‘IPv6 Address Mapping’ record. The equivalent of an A record, but for IPv6 addresses.
CNAME Record
The CNAME or ‘Canonical Name’ record is used for creating an alias of a domain name. For example, if you wanted your domain to redirect to google.com, you would use a CNAME.
MX Record
The MX record or ‘Mail Exchange’ record specifies the mail server which is responsible for handling email for that domain. When an external user sends an email to your domain, their mail server will perform a DNS lookup for the ‘MX’ record to find the IP address of the mail server to send the email to.
NS Record
The NS record or ‘Name Server’ record points to the authoritative name server for the domain in question. Usually, the NS records are configured separately on the domain registrar’s systems to point to the DNS server of your choice
PTR Record
The PTR or ‘Pointer’ record is used for reverse DNS lookups. It ties an IP address to a domain name in the format: 1.0.168.192.in-addr.arpa PTR notarealdomain.fake
TXT Record
The TXT or ‘Text’ record is used for storing any other textual data associated with the domain name. This is used a lot in SPF and DKIM for mail servers where a list of IP addresses, which can be used for sending mail from that domain (in the case of SPF) or a public key (in the case of DKIM), is stored as a TXT record.