DNS, DHCP | Cyber Security Tutorial - Learn with VOKS
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL
Back Next

DNS, DHCP

Learn this topic step-by-step with VOKS Tutorials.

What Is DNS?

DNS stands for:

Domain Name System

DNS is like a phone book for the internet.

  • Humans remember names like google.com
  • Computers communicate using IP addresses like 142.250.190.78

DNS translates human-friendly domain names into IP addresses so your computer can reach websites.

How DNS Works

  1. You type a website into your browser:
www.example.com
  1. Your computer asks a DNS server:

“Hey, what is the IP address for www.example.com?”

  1. The DNS server replies with the IP:
93.184.216.34
  1. Your computer connects to that IP to load the website.

DNS allows you to use names instead of numbers.

Testing DNS

On Linux/macOS:

nslookup www.google.com

On Windows:

nslookup www.google.com

You’ll see the IP address of the website.

What Is DHCP?

DHCP stands for:

Dynamic Host Configuration Protocol

DHCP automatically gives devices on a network:

  • IP address
  • Subnet mask
  • Gateway
  • DNS servers

Without DHCP, you would have to manually assign an IP to every device. That would be slow and error-prone.

How DHCP Works

  1. Your device connects to a network.
  2. It sends a request: “I need an IP address.”
  3. The DHCP server responds with an available IP and other network settings.
  4. Your device configures itself automatically.

Example:

  • Device asks for IP
  • DHCP assigns 192.168.1.20
  • Device can now communicate on the network

Checking Your IP Assigned by DHCP

On Linux/macOS:

ip addr

or

ifconfig

On Windows:

ipconfig

You’ll see your IPv4 address, subnet mask, and default gateway — all assigned by DHCP.

Difference Between DNS and DHCP

| Feature         | DNS                                                      | DHCP                                      |
|-----------------|----------------------------------------------------------|-------------------------------------------|
| Purpose         | Translates domain names to IP addresses                  | Assigns IP addresses and network settings |
| Works With      | Domain names, IP addresses                               | Devices connecting to a network           |
| Human-Friendly? | Yes, you type names                                      | Mostly invisible to users                 |
| Example         | [www.google.com](http://www.google.com) → 142.250.190.78 | Device gets 192.168.1.20 automatically    |


Why Both Are Important

  • DHCP makes it easy for devices to join networks automatically.
  • DNS makes it easy for humans to browse the internet without remembering IP numbers.

Together, they allow devices to connect seamlessly and access websites.

Simple Testing Commands

Check your IP (assigned by DHCP)

Linux/macOS:

ip addr

Windows:

ipconfig

Check DNS resolution

Linux/macOS:

nslookup www.google.com
dig www.google.com

Windows:

nslookup www.google.com

Ping a website to verify connectivity

Linux/macOS:

ping www.google.com

Windows:

ping www.google.com

Example Scenario

  1. You connect your laptop to Wi-Fi.
  2. DHCP gives your laptop IP 192.168.1.15, subnet mask 255.255.255.0, and DNS 8.8.8.8.
  3. You type www.example.com in your browser.
  4. Your computer asks the DNS server (8.8.8.8) for the IP.
  5. DNS replies 93.184.216.34.
  6. Your browser connects to 93.184.216.34 and loads the website.

All of this happens automatically in a few milliseconds.

# Linux/macOS - Check IP assigned by DHCP
ip addr
ifconfig

# Check DNS resolution
nslookup www.google.com
dig www.google.com

# Test connectivity
ping www.google.com

:: Windows - Check IP assigned by DHCP
ipconfig

:: Check DNS resolution
nslookup www.google.com

:: Test connectivity
ping www.google.com
QUICK KNOWLEDGE CHECK

Test Your Understanding

Answer 5 questions generated from this lesson. Your result is calculated instantly and is not saved.

0 / 5 answered
All Courses
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL
Course contents
Cyber Security
01 Introduction 02 Types of Cyber Threats 03 Cyber Security Domains 04 CIA Triad (Confidentiality Integrity Availability) 05 Career paths in Cyber Security 06 Certifications 07 Ethics and Responsible Disclosure 08 Laws and Regulation (e.g. GDPR, NDPR) 09 What is an OS? 10 Types: Window, Linus, macOS 11 Command-line vs GUI 12 OS Internals Overview (filesystems, processes, permissions) 13 Windows command prompt basics 14 Linux Bash Basics 15 File System Navigation 16 Basic Scripting 17 IP Addressing 18 DNS, DHCP 19 Mac Address 20 OSI VS TCP/IP Models 21 Ports and Protocols (TCP, UDP) 22 Common Protocols (HTTPS, FTP, SSH, etc.) 23 Packet structure 24 Firewalls, IDS/IPS, VPNs 25 Common attacks: MITM, Sniffing 26 Secure Network Practices 27 How the Web works 28 HTTP vs HTTPS 29 URLs, Headers, Cookies 30 Client-Server Architecture 31 Introduction To Web Security 32 OWASP Top 10 Overview 33 Common Threats (XSS, SQLi, CSRF) 34 Inpute validation and authentication flow 35 Basic Exploitation demo (e.g. XSS) 36 Burp Suite Introduction 37 Using a Browser For Testing 38 Password security 39 MFA-Antivirus 40 Cyber Hygeine Practice 41 Intro To Tools: Nmap, Wireshark, Netstat