DNS poisoning in Computer Networks - Time & Space Complexity
We want to understand how the effort to carry out DNS poisoning changes as the size of the network or number of DNS queries grows.
Specifically, how does the attack scale when more DNS requests happen?
Analyze the time complexity of this simplified DNS poisoning attempt process.
for each DNS query in network:
attacker sends many fake responses quickly
if fake response arrives before real one:
DNS cache is poisoned
else:
attacker tries again on next query
This code tries to poison DNS caches by racing real DNS replies with fake ones for each query.
Look for repeated actions that take time.
- Primary operation: Looping over each DNS query and sending multiple fake responses.
- How many times: Once per DNS query, with multiple fake responses per query.
As the number of DNS queries increases, the attacker must send more fake responses.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 queries | About 10 sets of fake responses |
| 100 queries | About 100 sets of fake responses |
| 1000 queries | About 1000 sets of fake responses |
Pattern observation: The effort grows roughly in direct proportion to the number of DNS queries.
Time Complexity: O(n)
This means the attack effort grows linearly with the number of DNS queries to poison.
[X] Wrong: "The attack effort stays the same no matter how many DNS queries happen."
[OK] Correct: Each DNS query requires a new attempt to send fake responses, so more queries mean more work.
Understanding how attack effort scales helps you think like a defender or attacker, a useful skill in network security roles.
What if the attacker could poison multiple DNS caches with one fake response? How would the time complexity change?
Practice
DNS poisoning in computer networks?Solution
Step 1: Understand DNS function
DNS translates website names into IP addresses so computers can find websites.Step 2: Identify DNS poisoning effect
DNS poisoning gives wrong IP addresses, sending users to fake sites instead of real ones.Final Answer:
To redirect users to fake websites by giving wrong IP addresses -> Option BQuick Check:
DNS poisoning = Redirect to fake sites [OK]
- Thinking DNS poisoning speeds up browsing
- Confusing DNS poisoning with encryption
- Believing it blocks websites instead of redirecting
Solution
Step 1: Recall DNS poisoning mechanism
DNS poisoning involves changing DNS cache entries to wrong IP addresses.Step 2: Match description to options
Only It modifies DNS cache with false information correctly states DNS poisoning modifies DNS cache with false info.Final Answer:
It modifies DNS cache with false information -> Option AQuick Check:
DNS poisoning = false DNS cache entries [OK]
- Confusing poisoning with encryption
- Thinking it speeds up DNS
- Assuming it blocks requests
example.com. Due to DNS poisoning, the DNS cache returns the IP 192.0.2.123 instead of the real IP 93.184.216.34. What is the likely result?Solution
Step 1: Understand DNS poisoning effect on IP
The DNS cache gives a wrong IP (192.0.2.123) instead of the real one (93.184.216.34).Step 2: Predict user experience
The user is sent to the wrong IP, likely a fake website pretending to be example.com.Final Answer:
The user is redirected to a fake website at IP 192.0.2.123 -> Option AQuick Check:
Wrong IP from DNS = fake site visit [OK]
- Assuming user reaches real site
- Thinking DNS query fails
- Believing browser blocks automatically
Solution
Step 1: Identify how DNS poisoning affects devices
DNS poisoning corrupts DNS cache with wrong IP addresses causing redirection.Step 2: Choose corrective action
Clearing DNS cache removes false entries, restoring correct address resolution.Final Answer:
Clear the DNS cache on affected devices and servers -> Option DQuick Check:
Fix DNS poisoning by clearing DNS cache [OK]
- Disabling firewall worsens security
- Changing passwords doesn't fix DNS
- Turning off internet is impractical
Solution
Step 1: Understand DNSSEC and trusted DNS servers
DNSSEC adds digital signatures to DNS data to verify authenticity. Trusted DNS servers reduce risk of poisoning.Step 2: Evaluate options for protection
Use DNSSEC to verify DNS data and configure trusted DNS servers combines verification and trusted sources, effectively reducing DNS poisoning risk.Final Answer:
Use DNSSEC to verify DNS data and configure trusted DNS servers -> Option CQuick Check:
DNSSEC + trusted DNS = strong DNS poisoning defense [OK]
- Thinking public Wi-Fi is safe
- Manually editing hosts is impractical
- Relying only on antivirus misses DNS attacks
Ready to prove it?
Pass the test and this pattern moves unknown
