شرح DHCP و DNS في CCNA: ما الذي يجعل الشبكات تعمل بصمت؟
شرح DHCP و DNS في CCNA ببساطة: بروتوكولين يعملان بهدوء خلف كل اتصال.
كلما اتصل جهاز بشبكة وتصفح موقعًا، يعمل بطرفين غير مرئيين خلف الكواليس:
- DHCP (بروتوكول تكوين المضيف الديناميكي) – يخصص عناوين IP تلقائيًا
- DNS (نظام أسماء النطاقات) – يترجم أسماء النطاقات إلى عناوين IP
كلاهما أساسي لشبكات مُختبر بشدة في اختبار CCNA.
ما هو DHCP؟
يخصص DHCP تلقائيًا عناوين IP, قناع الشبكة الفرعية, بوابات افتراضية،, و عناوين خوادم DNS لأجهزة على الشبكة.
بدون DHCP:
يجب عليك تكوين كل جهاز يدويًا.
مع DHCP:
يُخصص عناوين IP تلقائيًا — لا حاجة لإعداد يدوي.
كيف يعمل DHCP – عملية DORA
| الخطوة | الوصف |
|---|---|
| اكتشاف | يُرسل العميل طلبًا للعثور على خادم DHCP |
| عرض | يُرد الخادم بعنوان IP متاح |
| طلب | يطلب العميل قبول عنوان IP المعروض |
| تأكيد | يؤكد الخادم ويؤجر العنوان |
👉 يُعرف هذا العملية بـ DORA (اكتشاف، عرض، طلب، تأكيد).
تكوين DHCP في أجهزة توجيه Cisco
Router(config)# ip dhcp pool LAN-POOL
Router(dhcp-config)# network 192.168.10.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.10.1
Router(dhcp-config)# dns-server 8.8.8.8
Router(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.10
➡️ This sets up a pool of IP addresses and reserves .1 to .10 for static/manual assignments.
DHCP Relay: When the Server Isn’t on the Local Subnet
DHCP’s Discover message is a broadcast, and broadcasts do not cross a router by default – so a client on a subnet with no local DHCP server would never reach one sitting elsewhere on the network. The fix is a DHCP relay (also called an IP helper), configured on the router interface closest to the client:
Router(config)# interface gigabitEthernet 0/1
Router(config-if)# ip helper-address 192.168.1.5
This converts the client’s broadcast into a unicast packet aimed directly at the DHCP server’s address, and relays the server’s reply back the same way. This is exactly how most real enterprise networks work – one or two central DHCP servers, with every other subnet’s router relaying requests to them rather than running a DHCP server on every single subnet.
DHCP Troubleshooting Commands
When a client is not getting an address, these three commands narrow down the cause quickly:
Router# show ip dhcp binding
Router# show ip dhcp conflict
Router# debug ip dhcp server events
show ip dhcp binding confirms whether the router has actually leased an address to the client’s MAC – no binding means the Discover never reached the pool, which usually points back to a missing ip helper-address on the client’s subnet. show ip dhcp conflict shows addresses the server detected as already in use, often caused by a static IP accidentally set inside the DHCP pool’s range.
What is DNS?
DNS (Domain Name System) translates human-friendly domain names like google.com into machine-friendly IP addresses like 142.250.190.78.
Without DNS, users would need to remember numeric IP addresses to visit websites.
Testing DNS Resolution Directly
Before assuming a “website won’t load” problem is DNS, confirm it directly rather than guessing – a browser error message does not tell you which layer actually failed:
C:\> nslookup google.com
$ dig google.com
nslookup (Windows and also available on Linux/macOS) and dig (Linux/macOS, more detailed output) both query a DNS server directly and show exactly what it returned. If the lookup succeeds here but the website still does not load in a browser, the problem is not DNS – it is routing, a firewall, or the web server itself. This distinction, confirmed with one command instead of assumed, is exactly the kind of troubleshooting discipline the CCNA exam expects and that saves real time in the field.
How DNS Works – Step-by-Step
- You type
facebook.comin your browser. - The DNS resolver checks if it already knows the IP.
- If not, it queries a root server → top-level domain server → authoritative server.
- It returns the IP to your browser → website loads!
DNS Terms to Know (for CCNA)
| Term | الوصف |
|---|---|
| A Record | Maps domain to IPv4 address |
| AAAA Record | Maps domain to IPv6 address |
| CNAME | Alias for another domain |
| MX Record | Directs email to the mail server |
DHCP vs Static IP – When to Use What?
| DHCP (Dynamic) | Static IP |
|---|---|
| Automatically assigned | Manually configured |
| Great for clients | Best for servers, printers |
| Easy to manage | Harder in large networks |
| IP may change | IP remains the same |
🧪 CCNA Packet Tracer Lab – DHCP in Action
Lab Scenario:
You have a router, a switch, and multiple PCs. PCs should receive IPs automatically.
- Configure DHCP pool on router
- Connect PCs and enable DHCP
- Verify IPs are assigned correctly using
ipconfig
Optional: Assign a static IP to a printer or server and exclude that range.
📡 Real-World DNS Example
Let’s say you own yourbrand.com.
To point it to a hosting server:
- A Record → your website’s IP
- CNAME → alias like
blog.yourbrand.comto redirect to a CMS - MX Record → email hosting provider
DNS is the backbone of all web and mail-based services.
✅ Essential Network Devices for CCNA
🌐 Cisco DHCP Configuration Guide
🌐 How DNS Works – Cloudflare Docs
🙋♂️ FAQ – DHCP and DNS
What is DHCP in CCNA?
DHCP stands for Dynamic Host Configuration Protocol. It automatically assigns IP configuration to network devices, covered in CCNA exams and labs.
What does DNS do in a network?
DNS resolves domain names to IP addresses, allowing users to access websites using names instead of numbers.
Can I use DHCP and DNS together?
Yes. DHCP assigns the IP, and includes the DNS server address in the lease, allowing devices to resolve domain names immediately.
Is DHCP better than static IP?
For clients, yes. For devices like printers, servers, and routers — static IPs are preferred.
إذا كنت تفضّل أن يشرح لك أحدهم ذلك خطوة بخطوة، أو تحتاج إلى مختبر Packet Tracer محدد مكتمل ومشرح بدلاً من أن تحله بنفسك، راجع دروس CCNA و Packet Tracer الصفحة التي توضح كيفية عمل ذلك.

