2026-07-13 12:08

Status:


BBCN - Module 4 - Networking Services

Name Resolution

  • Why do we need DNS?:
    • Computers are only able to understand numbers that are binary in nature
    • This is hard for humans to understand though, so we abstract it out into things we can actually read
    • Basically, you don’t need to remember the exact IP address of each single website that you want to visit
    • Domain Name System (DNS)- a global and highly distributed network service that resolves strings of letters into IP addresses for you
    • Domain Name- the term we use for something that can be resolved by DNS, basically the name of the website
    • Convenient as well because you can change the under lying IP but then still have the same domain name
    • DNS also allows for faster connect times because it can help to see where in a current region you might be, and resolve you over to an IP that is closer to you holding that data. So basically letting you use the same domain name connect you over to the nearest data server for the fastest experience
  • The Many Steps of Name Resolution:
    • Name Resolution- Process of using DNS to turn a domain name into an IP address is known as name resolution

    • A DNS server must be configured for a given device, along side the IP address assigned to it, the Gateway host, and the subnet mask for the IP address as well

    • Five primary types of DNS servers:

      1. Caching name servers
      2. Recursive name servers
      3. Root name servers
      4. TLD name server
      5. Authoritative name servers
    • A single server may fulfill multiple of these roles though

    • Caching and Recursive Name Servers- purpose is to store known domain name lookups for a certain amount of time, basically you hold the name of known sites for a good little while, as long as you need them. These are generally provided by an ISP

    • Recursive Name Servers- Performs full DNS resolution requests, basically also in tandem with the caching and recursive servers

    • Pasted image 20260713141247.png

    • Basically, if the server does not know the IP of that domain name, then what it does is use the recursive part of the server to get that IP from somewhere it is stored, and then holds that information for a little while inside of itself, so whenever another computer asks for that IP address, it has it ready to go

    • Time To Live (TTL)- a value, in seconds, that can be configured by the owner of a domain name for how long a name server is allowed to cache an entry before it should discard it and perform a full resolution again

    • Pasted image 20260713141700.png

    • The server goes over to the 13 root servers in order to get the IP address for the domain name that it does not known, these were originally placed strategically, but are now more accessible via Anycast

    • Anycast- a technique that’s used to route traffic to different destination depending on factors like location, congestion, or link health

    • A computer can send a datagram to a given IP, but then can see it routed to many different places based on many factors.

    • There also are not only 13 root servers anymore, and they are more so 13 authorities that provide root name look up as a service

    • Top-Level domain (TLD)- represents the top of the hierarchical DNS name resolution system, it is the last part of any domain name, something like .com or .org

    -Pasted image 20260713142151.png

    • Basically, whenever a domain name is unknown, it goes through to the 13 root servers which house the Top Level domains, based on this top level domain, it gives another address over to the TLD name servers, which hold the actual reference to whatever that domain name might be, so basically the server that is controlled by facebook or whatever. Then that value there finds that specific site and redirects the traffic to the server that holds that actual information that someone might want to access
    • This full look up makes sure that malicious parties do not have a way of redirecting whatever your traffic is over to their site for whatever purpose
  • DNS and UDP:
    • DNS uses UDP instead of TCP for the transport layer

    • This is because UDP is connectionless and therefore is much smaller, allowing for easier traffic

    • A single DNS request can also generally fit inside of a single UDP datagram

    • DNS can generate a LOT of traffic because of all of the steps that need to be taken

    • Therefore, the 3 way handshake to only start the connection would be a lot more steps and a lot slower of a connection, it is much safer yes, but it does not need to happen all the time for DNS requests

    • Pasted image 20260713142909.png

    • Due to the 3 way and 4 way handshake, this it the number of packets sent via TCP

    • Pasted image 20260713143021.png

    • This is the same process with UDP, basically no acknowledgement needs to be done, and so only the actual sending of the data needs to happen, meaning only 8 packets are actually sent through

Name Resolution In Practice

  • Resource Record Types:
    • DNS operates with a set of defined resource types, allowing for different types of DNS resolutions to take place

    • A record- Used to point a certain domain name at a certain IPv4 IP Address.

    • A single a record is configured for a single domain name, however, a single domain name may have multiple A records connected to it, it’s basically just a straight shot over to that IP address via that domain

    • Basically, you can set up multiple A records for a given domain name to spread traffic across different servers, then basically going and iterating over them to make sure they each get an even amount of traffic

    • A good way to think about this is all of the different servers that might exist for the pirating sites, like if one server’s IP fails or doesn’t have the needed domain content, then you can route it over to the next one in the list

    • The traffic is still evenly distributed though, as when the next computer to perform a look up for the domain name does so on the network, it will instead get the next IP address in the list of IP addresses

    • Quad A Record- very similar to an A record, except that it returns an IPv6 address instead of an IPv4 address.

    • It still does the round robin thing and everything, it’s basically the same but just the different IP version

    • CNAME record- Used to redirect traffic from one domain name to another

    • Basically, it makes it so if you ever type in something like ‘microsoft.com’ instead of ‘www.microsoft.com’ that it will be able to redirect that network traffic over to the right instance of the IP via that DNS resolution

    • It basically means you have to change the canonical name (CNAME) of a server in one place, the head place where all of the traffic is meant to go

    • Basically, if you ever want to change the underlying IP address, you can only change the main one instead of the other ones because they just point to the main one

    • Mail Exchange (MX)- this resource record is used in order to deliver email to the correct server

    • Mail and web servers are usually run on different machines with different IP addresses, so it basically makes it easy to guarantee that certain traffic goes to a certain server and is easily distinguishable from regular network traffic

    • Service Record (SRV)- used to define the location of various specific services

    • It basically does the same thing as the MX service types, however it is able to be used for multiple different types. For example sometimes used for calendar data or something like that

    • Text record (TXT)- originally intended to be used only for associating some descriptive text with a domain name for human consumption

    • It is basically used to convert addition data that describes how the data should be processed

    • It is entirely free form

    • Used to communicate configuration preferences with other companies basically

  • Anatomy of a Domain Name:
    • Each domain name has three different types

    • Each of them is separated by a period

    • The last part of a domain name is known as a TLD (Top level Domain name)

    • There are some country specific ones, I mean you know this stuff

    • Some vanity TLDs also exist like .pizza

    • ICANN is responsible for the creation and delegation of TLDs

    • A domain is the actual name of the website, allowing for the DNS request to move from a TLD server over to an actual authoritative server owned by the company

    • Domains can be created or chosen by anyone

    • Then the WWW stands for the world wide web

    • Fully qualified domain name (FQDN)- the full name of a domain

    • It costs money to register a domain, however sub domains or registrars for that domain can be created without extra cost

    • DNS can support up to 127 levels of domain in total for a single fully qualified domain name

  • DNS Zone:
    • An authoritative name server is responsible for a DNS zone

    • The DNS zones are a hierarchical concept, and each given server set can be responsible for a zone

    • The root servers are responsible for the root zone for example

    • Zones do not over lap, they basically all hold their own domain

    • DNS zones allow for easier control over multiple levels of a domain

    • You can basically split up your several DNS traffic into different zones which makes them easier to handle, this is done with sub domains and each sub domain then get’s it’s own authoritative zone

    • Zone Files- simple configuration files that declare all resource records for a particular zone

    • Start of Authority (SOA)- declares the zone and the name of the name server that is authoritative for it

    • NS records- indicate other name servers that might also be responsible for this zone

    • You might also find some of the other record types here as well as previously discussed, it it also to be noted that a single zone might be more than one server just as a form of backup

    • Zones can also go very deep, like zones, but they rarely do

    • Reverse lookup zone files- These let DNS revolvers ask for an IP and get the FQDN associated with it returned, basically a reverse look up

    • Pointer record (PTR)- resolves an IP to a name

Dynamic Host Configuration Protocol

  • Overview of DHCP:
    • In order for the TCP connect to work and connect a network to the internet, each node on a network must have:

      • IP address
      • Subnet mask
      • Gateway
      • Name server
    • When configuring these, it can be tedious

    • A lot of the items can be same for all of the nodes, but each device needs to have a different IP address

    • Dynamic Host Configuration Protocol (DHCP)- basically allows for dynamic assignment of an IP address to a given device whenever it connects over to a network

    • It is an application layer protocol that automates the configuration process of hosts on a network

    • It allows for the assignment of all needed network information as soon as a device connects to the network, allowing for a dynamic IP

    • Only things like servers, gateways or devices that need their IP constant and known would therefore need something like a static IP

    • Using a DHCP server, you can configure a bunch of client devices with a range of IP devices set aside from them

    • Basically makes life a LOT easier

    • Dynamic Allocation- the most common, a range of IP addresses is set aside for client devices and one of these IPs is issues to these devices when they request one

    • The IP is different each time the computer connects to the network

    • Automatic allocation- a range of IP addresses is set aside for assignment purposes, very similar to dynamic allocation, however the DHCP server is assigned to remember who it assigned an IP too, and assign the same IP if it detects that device again

    • Fixed allocation- requires a manually specified list of MAC addresses and their corresponding IPs, can be used as a security measure so only devices with known MAC addresses get a proper IP

  • DHCP in Action:
    • DHCP is an application layer protocol

    • It relies on the transport, network, and data link layers to work

    • The entire point of it though is used to configure the network layer

    • DHCP discovery- the process by which a client configured to use DHCP attempts to get network configuration information

    • Pasted image 20260713154540.png

    • Four steps-

      1. First the discovery step, where the client sends out a discover message, it does not have an IP, and does not know the IP, it just sends out a given signal on port 67
      2. This is then captured into the IP datagram with the above IP addresses
      3. This then sends out the request to every single node on the network, and if a DHCP server is present, it gets the message
      4. Then the DHCP server checks to see how it should assign an IP address based on it’s given protocol
    • Pasted image 20260713154827.png

    • The response from the DHCP server is then sent out as a DHCPOFFER message with all of the given data above

    • This is also a broadcast and reaches all over the network, with the client then being able to decern that the given message was for it

    • The client machine processes the offer, and sees whether or not it can accept the IP offered to it

    • It will usually say yes to this offer, however, it can say no in the instance that multiple DHCP servers are running and two servers try to offer an IP to the same device

    • After receiving the offer message, the client then responds back with a DHCP REQUEST message, basically saying yes, the IP was accepted or was not accepted, and given the IP has not yet been given, it is still sent the same way as in the first image

    • The server then responds with a DHCP ACK message with the same method of the DHCP OFFER, and now is basically able to have all of the information needed to connect itself to the network

Network Address Translation

  • Basic of NAT:
    • Network Address Translation (NAT)- a technique instead of a defined standard, and is therefore different for different OS and what not

    • It takes one IP address and transforms it into another

    • It can be done for security

    • Or even for preserving the limited amounts of IPv4 space

    • NAT is a technology that allows for a gateway, usually a router or firewall, to rewire the source IP of an outgoing IP datagram while retaining the original IP in order to rewrite it into the response

    • Basically, what this does, is imagine a router right, and this router gets data from one network that it is connected to, normally it would strip the ethernet frame, decrement the TTL value, and then recalculate the checksum, this method still does all of that, but now instead of the source IP being from the original sender, it basically rewrites that source IP to be from the router

    • This is basically hiding the IP of computer one from that of computer 2, known as IP masquerading

    • Basically, nobody can establish a connection to your given computer because they don’t know it, meaning the entire network is pretty much invisible

  • Nat and the Transport Layer:
    • NAT on the network layer is simple, it just changes the IP addresses, but it is a little bit more difficult with the transport layer

    • This is because if the data needs to go back, the original IP is lost, and so it does not know which computer to send the data back to, so it does something called Port Preservation

    • Port preservation- a technique where the source port chosen by a client is the same port used by the router

    • Basically, the device sets up an outbound port from one of the ephemeral ports, so ports > 50,000. The router then basically keeps track of this open port, which doesn’t reveal any real data about the network, and just sends back the data it receives to that given port

    • Port forwarding- a technique in which specific destination ports can be configured to always be delivered to specific nodes, therefore, if any data is sent over to a given router that has support for NAT, then if that data matches the data for an open port, it will always send the data to that port

    • It means that your IP is still entirely safe, however the data is open to anyone that wants to direct the traffic to that port

==VPNs and Proxies

  • Virtual Private Network:
    • VPN- a technology that allows for the extension of a private or local network to hosts that might not work on that same local network

    • Used most commonly for an employee to access their network whenever they are not in the office

    • Basically a tunneling protocol, it sets up specific access to a given server while keeping a network entirely secure

    • Pasted image 20260713161933.png

    • It provides them with an IP address that matches that of the network that they have connected to

    • This way, it can basically access the same data as if it was on the actual network

    • Most VPNs work by using the payload section of the transport layer to carry an encrypted payload that basically contains and entire second set of packets, basically, the TCP segments contain an encrypted version of the standard IP, TCP payloads that are meant to traverse the entire inner network, sort of a network within a TCP segment

    • This whole process still basically runs through several routers in order to reach the given router, but is much safer because of the encryption of the data that the VPN server can decode

    • VPN servers also often times have protocols that make it difficult to connect to them unless specified / authorized to do so, often times with 2FA

    • Two-factor authentication- a technique where more than just a username and password are required to authenticate

    • VPNs can also be connected to one another, in conceptually the same way that they connect a regular client to oneself, via the VPN tunnel, so two different LANs can communicate over long distances

  • Proxy Services:
    • Proxy service- a server that acts on behalf of a client in order to access another service

    • These sit between clients and other servers in order to provide the following benefits

      1. Anonymity
      2. Security
      3. Content Filtering
      4. Increased performance
    • Basically these are sort of a middle man that lets the content from a given server be accessed on a specifically designed one, like a gateway router basically, it abstracts out the data

    • Web Proxies are proxy services that are primarily used for web traffic

    • It basically allowed for increase performance because the web proxy was able to retrieve the data from the web server at a faster rate than say a single web client could, caching the data if it is needed again, however this form is fairly old

    • A more common use of a web proxy today might be to stop someone from allowing someone to access a given site entirely, think of for example things like schools blocking websites for students, this can be done via these web proxies on the schools network

    • They basically forward all of the traffic on the network to that web proxy, inspect it, and then either allow or disallow that traffic

    • Reverse Proxy- a service that might appear to be a single server to external clients, but it actually represents many servers living behind it, directing out the incoming client requests over to wherever they might be needed, think of maybe like a router or something similar to that

==Glossary

A record: The most common resource record, used to point a certain domain name at a certain IPv4 IP address

Anycast: A technique that’s used to route traffic to different destinations depending on factors like location, congestion, or link health

Automatic allocation: A range of IP addresses is set aside for assignment purposes

Caching and recursive name servers: They are generally provided by an ISP or your local network, and their purpose is to store domain name lookups for a certain amount of time

CNAME: A resource record used to map one domain to another

DHCP discovery: The process by which a client configured to use DHCP attempts to get network configuration information

Domain Name System (DNS): A global and highly distributed network service that resolves strings of letters, such as a website name, into an IP address

DNS zones: A portion of space in the Domain Name System (DNS) that is controlled by an authoritative name server

Domain: Used to demarcate where control moves from a top-level domain name server to an authoritative name server

Domain name: A website name; the part of the URL following www.

Dynamic allocation: A range of IP addresses is set aside for client devices and one of these IPs is issued to these devices when they request one

Fixed allocation: Requires a manually specified list of MAC address and the corresponding IPs

Fully qualified domain name: When you combine all the parts of a domain together

IP masquerading: The NAT obscures the sender’s IP address from the receiver

MX record: It stands for mail exchange and this resource record is used in order to deliver email to the correct server

Name resolution: This process of using DNS to turn a domain name into an IP address

Network Address Translation (NAT): A mitigation tool that lets organizations use one public IP address and many private IP addresses within the network

NS record: It indicates other name servers that may also be responsible for a particular zone

NTP servers: Used to keep all computers on a network synchronized in time

Pointer resource record: It resolves an IP to a name

Port forwarding: A technique where specific destination ports can be configured to always be delivered to specific nodes

Port preservation: A technique where the source port chosen by a client, is the same port used by the router

Proxy service: A server that acts on behalf of a client in order to access another service

Quad A (AAAA) record: It is very similar to an A record except that it returns in IPv6 address instead of an IPv4 address

Recursive name servers: Servers that perform full DNS resolution requests

Reverse lookup zone files: They let DNS resolvers ask for an IP, and get the FQDN associated with it returned

Reverse proxy: A service that might appear to be a single server to external clients, but actually represents many servers living behind it

Round robin: It is a concept that involves iterating over a list of items one by one in an orderly fashion

SRV record: A service record used to define the location of various specific services

Start of authority: A declaration of the zone and the name of the name server that is authoritative for it

Top Level Domain (TLD): The top level of the DNS or the last part of a domain name. For example, the “com” in www.weather.com

Time-To-Live field (TTL): An 8-bit field that indicates how many router hops a datagram can traverse before it’s thrown away

Two-factor authentication: A technique where more than just a username and password are required to authenticate. Usually, a short-lived numerical token is generated by the user through a specialized piece of hardware or software

TXT record: It stands for text and was originally intended to be used only for associating some descriptive text with a domain name for human consumption

Types of DNS servers: There are five primary types of DNS servers; caching name servers, recursive name servers, root name servers, TLD name servers, and authoritative name servers

Virtual Private Network (VPN): A technology that allows for the extension of a private or local network, to a host that might not work on that same local network

Zone Files: Simple configuration files that declare all resource records for a particular zone


References

dns_resolution_path.png
dhcp_dora_sequence.png