Network services

10 minuti

Modern networks would be unmanageable without automated services that hand out IP addresses, translate names to numbers, and keep every device’s clock in sync. DHCP (Dynamic Host Configuration Protocol) configures IPv4 and IPv6 addresses automatically. SLAAC (Stateless Address Autoconfiguration) lets IPv6 devices build their own addresses without a central server. DNS (Domain Name System) resolves human-readable names into IP addresses. Time synchronisation via NTP (Network Time Protocol), PTP (Precision Time Protocol), and authenticated NTS (Network Time Security) ensures log timestamps align and security protocols can validate tickets. These notes follow Prof. Messer’s Network+ N10-009 videos: DHCP, Configuring DHCP, IPv6 and SLAAC, An Overview of DNS, DNS Records, and Time Protocols.

⏱ Video — DHCP (8:42): 0:02 bootp history · 0:36 dhcp replaces bootp · 1:12 the dora process · 1:50 discover phase · 3:14 offer phase · 4:10 request phase · 4:55 acknowledgement · 5:41 broadcast limitation · 6:36 dhcp helper and relay

⏱ Video — Configuring DHCP (10:09): 0:02 scope and pool · 1:25 scope on windows server · 2:22 lease process · 2:51 mac address tracking · 3:14 address reservation · 4:49 lease timers · 5:55 t1 and t2 timers · 7:57 dhcp options

⏱ Video — IPv6 and SLAAC (4:43): 0:01 dhcpv6 · 0:36 stateless autoconfiguration · 1:01 ndp vs arp · 1:30 slaac · 1:53 duplicate address detection · 2:08 router solicitation and advertisement · 2:51 slaac process in detail · 3:40 interface identifier

⏱ Video — An Overview of DNS (16:46): 0:02 name resolution · 0:34 root servers and tlds · 1:22 fully qualified domain names · 2:30 redundant dns servers · 3:42 primary vs secondary · 4:00 hosts file · 5:36 forward lookup · 6:10 reverse lookup · 7:12 authoritative vs non-authoritative · 8:41 caching and ttl · 10:12 recursive queries · 14:14 dnssec · 15:25 dns over tls and dns over https

⏱ Video — DNS Records (8:54): 0:01 record types overview · 0:50 soa record · 1:15 a and aaaa records · 2:30 cname records · 3:56 mx records · 5:04 txt records (spf, dkim) · 6:45 ns records · 7:20 ptr records

⏱ Video — Time Protocols (4:53): 0:02 ntp overview · 0:50 ntp server and client · 1:40 server-client architecture · 2:18 time as a security concern · 2:56 network time security · 3:35 nts two-step process · 4:08 precision time protocol · 4:41 ptp hardware

DHCP

Before DHCP, every IPv4 address, subnet mask, and DNS setting was entered manually on each device. The earlier BootP (Bootstrap Protocol) automated some of this but could not reclaim unused addresses. DHCP replaced BootP and added automatic lease management.

The DORA process

A DHCP client obtains an address in four broadcast steps, remembered as DORA:

StepNameDirectionPortsDetails
DDiscoverClient broadcastUDP 68 → 67Sent from 0.0.0.0 to
255.255.255.255
OOfferDHCP server broadcastUDP 67 → 68Proposed IP address
RRequestClient broadcastUDP 68 → 67Client selects one offer
AAcknowledgeDHCP server broadcastUDP 67 → 68Server confirms
lease

All four messages are broadcasts (destination 255.255.255.255) because the client has no IP address yet and cannot send unicast. If multiple DHCP servers exist on the subnet, the client may receive several offers and chooses one.

DHCP relay / DHCP helper

Broadcasts do not cross a router. In an enterprise with centralised DHCP servers, a DHCP relay (also called a DHCP helper) is configured on the router. The relay intercepts the broadcast, changes the source IP to the router’s interface IP, sets the destination to the remote DHCP server, and forwards it as unicast. The response travels the reverse path: unicast to the router, then broadcast back to the client.

Scope, lease, and options

A DHCP scope defines the pool of addresses for a subnet. It includes the IP range, exclusions, subnet mask, lease duration, and optional settings.

  • Lease duration: how long a client may use an address. Two timers control renewal:
    • T1 (renewal timer) at 50% of the lease — the client tries to renew with the original server.
    • T2 (rebinding timer) at 87.5% — if the original server is unavailable, the client tries any DHCP server.
  • Address reservation (also called static DHCP assignment): the DHCP server maps a MAC address to a fixed IP address so a printer or server always receives the same address without manual configuration.
  • DHCP options are numbered fields — 254 usable options defined in RFCs, originally called vendor extensions in BootP. Common options include DNS servers, default gateway, and domain name. Specialised options include option 129 (VoIP call server IP address) and option 135 (HTTP proxy). Not all DHCP servers support every option.

DHCP also tracks MAC-to-IP bindings; if a device returns to the network and its previous IP is still available, the server offers the same address.

IPv6 and SLAAC

DHCPv6 works similarly to DHCPv4 but is not required. IPv6 can configure itself through stateless autoconfiguration — no server needed, no lease time, no IP or MAC tracking.

NDP replaces ARP

NDP (Neighbor Discovery Protocol) replaces IPv4’s ARP (Address Resolution Protocol). Where ARP uses broadcasts, NDP uses multicast, which is far more efficient. NDP also handles router discovery:

  • Router Solicitation (RS) — a device multicasts “any routers here?”
  • Router Advertisement (RA) — the router responds with prefix, prefix length, DNS configuration, and other IPv6 parameters. Routers also send unsolicited RA messages periodically to a multicast address.

SLAAC — Stateless Address Autoconfiguration

  1. The device sends a Router Solicitation via NDP and receives a Router Advertisement containing the 64-bit subnet prefix.
  2. The device builds the remaining 64-bit interface identifier either by inserting FFFE into its MAC address (the EUI-64 method) or by generating a random value.
  3. DAD (Duplicate Address Detection) uses NDP to check whether any other device already uses the proposed address. If the address is unique, the device assigns it and becomes reachable.

DNS

DNS translates human-readable names (e.g. www.professormesser.com) into IP addresses. It is a hierarchical database.

Hierarchy

LevelExampleRole
Root.13 server clusters, over 1,000 actual servers
TLD (Top-Level Domain).com, .org, .usGeneric (gTLD) or
country-code (ccTLD)
Second-levelprofessormesserOwned by the organisation
SubdomainwwwSpecific host or service

A fully qualified domain name (FQDN) follows this chain from leaf to root, e.g. www.professormesser.com. (trailing dot is the root).

Primary and secondary servers

  • Primary DNS server: holds the writable zone files. All configuration changes happen here.
  • Secondary DNS server: receives a read-only copy pushed from the primary. End users cannot tell which server answered.

Forward and reverse lookup

  • Forward lookup: give the DNS server a name, get back an IP address. Prof. Messer’s dig www.professormesser.com shows three IP addresses for the web server (fronted by Cloudflare).
  • Reverse lookup (using PTR records): give the DNS server an IP address, get back a name. IP addresses are written in reverse order (e.g. 23.168.192.in-addr.arpa for 192.168.23.x). A reverse lookup of one www IP returned cruise.ns.cloudflare.com.

The hosts file

Before querying a DNS server, most operating systems check a local hosts file. On Windows it lives at C:\Windows\System32\drivers\etc\hosts; on Linux/macOS at /etc/hosts. It is a plain-text file mapping IP addresses to names. Some applications bypass the hosts file and query the DNS server directly.

Authoritative vs non-authoritative

An authoritative server is the primary source for a zone. A non-authoritative server (a caching or secondary server) holds a copy that might be outdated. Resolvers see answers flagged accordingly — e.g. nslookup shows “Non-authoritative answer” when data comes from cache.

Recursive queries

When your local DNS server does not have a cached answer, it performs a recursive query on your behalf:

  1. Your device (the resolver) queries the local DNS server.
  2. The local server queries a root server — the root does not know the answer but knows where the TLD server is.
  3. The local server queries the TLD server, which points to the domain’s authoritative name server.
  4. The local server queries the authoritative server and gets the IP address.
  5. The answer is cached on the local server so subsequent queries are instant.

Caching and TTL

The TTL (Time to Live) in DNS is measured in seconds — the maximum time a non-authoritative server may cache the answer. dig www.professormesser.com shows TTL 300 (5 minutes). Once the TTL expires, the cached entry is deleted and the next query goes back to the authoritative server.

DNS security extensions

MechanismWhat it doesPort / note
DNSSECDigitally signs DNS responses so clients can verify they
came from a trusted sourceAuthenticates but does not encrypt — queries
still in the clear
DNS over TLS (DoT)Encrypts the entire DNS query using TLS**TCP
853**
DNS over HTTPS (DoH)Encapsulates DNS in HTTPS traffic — looks like
normal web trafficTCP 443; many modern browsers use DoH by default

Traditional DNS sends everything in the clear — anyone monitoring the link can see which domains are being resolved. DNSSEC prevents tampering but does not hide the query; DoT and DoH add encryption for privacy.

DNS record types

RecordPurposeExample
SOAStart of Authority — zone overview (serial, retry, expiry)
First line in the zone file
AMaps a hostname to an IPv4 address`www IN A
162.159.246.164`
AAAA (quad A)Maps a hostname to an IPv6 address`www IN AAAA
2001:db8::1`
CNAMECanonical Name — alias from one name to another`chat IN
CNAME mail.example.com`
MXMail Exchanger — mail server for the domain`IN MX 10
mail.example.com`
TXTText record — for SPF (Sender Policy Framework) and DKIM
(DomainKeys Identified Mail) public keys`“v=spf1 include:mailgun.org
~all”`
NSName Server — authoritative servers for the domain`IN NS
ns1.example.com`
PTRPointer — reverse lookup: IP to hostname
23.168.192.in-addr.arpa IN PTR joe.example.com

SPF records tell receiving mail servers which hosts are permitted to send mail for your domain, helping prevent email spoofing. DKIM records publish a public key so recipients can verify the digital signature on incoming mail.

Time Protocols

NTP — Network Time Protocol

NTP synchronises clocks across all network devices — desktops, servers, switches, routers, and firewalls — so log timestamps match. It uses UDP port 123.

  • NTP server: responds to time requests from clients. It does not update its own clock from those requests.
  • NTP client: queries a server to obtain the latest time. The same device can run both a server (handing time to others) and a client (querying an upstream server).

NTP normally sends time data in the clear — the time of day is generally not considered private — but incorrect time breaks security protocols. Kerberos authentication in Windows networks fails if the client and server clocks differ by more than five minutes. An attacker who can provide wrong time could cause a denial of service. With a local NTP server, accuracy is roughly 10 milliseconds.

NTS — Network Time Security

NTS adds authentication to NTP so clients can trust the time response.

  1. The client performs a TLS handshake with an NTS key exchange server.
  2. The key exchange server returns a cookie.
  3. The client includes the cookie in its NTP query to the time server.
  4. The NTP server validates the cookie and returns a trusted timestamp.

PTP — Precision Time Protocol

PTP provides hardware-based time synchronisation with granularity down to the nanosecond. It runs on dedicated hardware separated from the operating system and applications, avoiding delays from third-party processes. PTP is especially important in industrial environments where extremely precise timestamps are required across all devices.

Where attacks live — mental map (beyond the video)

Not from the video — why this matters for security.

  • DHCP rogue server: an attacker plugs in a device that answers DHCP discover messages before the legitimate server, handing out a malicious gateway and DNS server — a classic man-in-the-middle setup.
  • DNS cache poisoning: injecting forged answers into an unencrypted DNS response or caching server redirects users to attacker-controlled sites. DNSSEC prevents this but does not encrypt queries — traffic analysis still leaks the domains visited.
  • DNS privacy leaks: traditional DNS queries travel in the clear; any network tap or rogue AP can log every domain a user resolves. DoT and DoH close this gap, though DoH traffic looks like HTTPS and can bypass enterprise content filters.
  • NTP reflection/amplification DDoS: NTP servers that respond to monlist requests can amplify a small spoofed query into a large response, overwhelming a victim.
  • Time manipulation attacks: if an attacker controls the NTP source (rogue server or spoofing), clock drift can break Kerberos authentication, invalidate TLS certificates, and corrupt audit logs.
  • IPv6 SLAAC privacy: a device using an EUI-64-derived interface identifier embeds its MAC address in the IPv6 address, making it globally trackable across networks — random interface identifiers mitigate this but are not always the default.