0
0
Computer Networksknowledge~15 mins

DNS (Domain Name System) in Computer Networks - Mini Project: Build & Apply

Choose your learning style9 modes available
Understanding DNS (Domain Name System)
📖 Scenario: You want to understand how the Domain Name System (DNS) works by creating a simple representation of DNS records and how they map domain names to IP addresses.
🎯 Goal: Build a simple DNS record dictionary, add a query domain, find the IP address for that domain, and complete the lookup process.
📋 What You'll Learn
Create a dictionary with domain names as keys and IP addresses as values
Add a variable for the domain name to query
Write code to find the IP address for the query domain using the dictionary
Complete the lookup by storing the result in a variable
💡 Why This Matters
🌍 Real World
DNS is used every time you visit a website to translate the domain name into an IP address computers understand.
💼 Career
Understanding DNS is important for network administrators, web developers, and IT professionals who manage internet connectivity and website hosting.
Progress0 / 4 steps
1
Create DNS records dictionary
Create a dictionary called dns_records with these exact entries: 'example.com': '93.184.216.34', 'openai.com': '104.18.30.162', and 'github.com': '140.82.114.4'.
Computer Networks
Need a hint?

Use curly braces {} to create a dictionary with domain names as keys and IP addresses as values.

2
Add query domain variable
Create a variable called query_domain and set it to the string 'openai.com'.
Computer Networks
Need a hint?

Assign the domain name you want to look up to the variable query_domain.

3
Lookup IP address for query domain
Create a variable called ip_address and set it to the value from dns_records for the key query_domain.
Computer Networks
Need a hint?

Use the dictionary key access syntax dns_records[query_domain] to get the IP address.

4
Complete DNS lookup process
Create a variable called lookup_result and set it to a string that says "The IP address of {query_domain} is {ip_address}" using an f-string.
Computer Networks
Need a hint?

Use an f-string to combine the domain and IP address into a readable message.