Local DNS Hacking
Fun: Force your End Users to use “your site” (local DNS “hacking”)
OK OK, this is not real hacking but it’s fun 🙂 As well as there are some attack types, where the browser is been hijacked so the User can’t go to some specific web pages or the user will be forced to open that page as soon as they use they Internet browser, where the user will be directed to the FAKE/ phishing web page or malware loaded local site)
By default, when a Windows PC User tries to open a website from a browser, Windows will try to resolve the website name to its IP address from the local DNS cache.
The local cache is stored :
C:\Windows\System32\drivers\etc\hosts
If this fails, it will query the host file and if there is no entry to the website there , then it will contact the DNS server which is set up in your NIC (Network Card) .
If there is any entry in the local cache , the PC will load or block that site depending on your settings. To make sure there is nothing in the DNS cache, you have to clear it so the little fun trick can work on your “victim” user or if you can :
open CMD and type “ipconfig /flushdns” or restart the DNS service from the services tab.
Open the file via typing “C:\Windows\System32\drivers\etc\hosts” in to the search area in your start menu
This will open the HOST File for you ( it will ask you, how you want to open the file type, select via NOTEPAD) , which is inside the “etc” section of your drivers
add an entry as below:
127.0.0.1 domainname.com
(domainname.com being the website you want to block. Save the hosts file outside the etc folder and then move it there, replacing the older version, as Windows won’t let you save the file there directly. Also make sure there’s no extension like .txt at the end of the file name)
This way whenever a user tries to go to anything.domainname.com, their browser redirects them to 127.0.0.1 which is the local host. Or maybe you can redirect them to an HTML page stating the reason why that page is blocked from within your organization.
PS: It’s always a good practice to “copy the original” HOST file, so when the FUN is over, everything can be loaded to its original state.
More How to blogs

Local DNS hacking refers to techniques where attackers manipulate the Domain Name System (DNS) settings on a victim’s computer or their local network to redirect internet traffic. It’s a sneaky way to misdirect users to malicious websites or intercept their online communications.
Here’s how local DNS hacking typically works:
1. Malware-Based Attacks:
- Trojan Horse: Attackers trick users into installing malware disguised as legitimate software. This malware can then modify the local DNS settings on the victim’s computer.
- DNS Changer: The malware alters the preferred DNS server address in the network settings. Instead of using a legitimate DNS server provided by your ISP, it points your computer to a rogue DNS server controlled by the attacker.
2. Router-Based Attacks:
- Exploiting Vulnerabilities: Many home routers have known vulnerabilities or weak default passwords. Attackers can exploit these weaknesses to gain access to the router’s settings.
- DNS Server Modification: Once they control the router, attackers can change its DNS settings to redirect all traffic from devices connected to that network.
Consequences of Local DNS Hacking:
- Phishing Attacks: Users might be redirected to fake websites that mimic legitimate ones (like banks or online stores) to steal login credentials or financial information.
- Malware Distribution: Victims can be directed to websites that automatically download malware onto their devices.
- Data Interception: Attackers can intercept sensitive data, like online banking transactions or emails, as it travels through their rogue DNS server.
- Censorship and Content Filtering: Attackers can block access to certain websites or manipulate search results to control the information users can access.
How to Protect Yourself from Local DNS Hacking:
- Keep Software Updated: Install operating system and software updates regularly to patch vulnerabilities that attackers might exploit.
- Use Strong Passwords: Use strong, unique passwords for your router and computer. Change default router passwords immediately.
- Beware of Suspicious Downloads: Only download software from trusted sources. Be cautious of email attachments and links from unknown senders.
- Use Anti-Malware Software: Install reputable anti-malware software and keep it updated to detect and remove malicious software.
- Monitor Network Traffic: Use network monitoring tools to identify unusual activity that might indicate a DNS hijacking attack.
- Use a VPN: A VPN can encrypt your internet traffic and route it through a secure server, making it more difficult for attackers to intercept your data or redirect your traffic.
Local DNS hacking can be a serious threat, but by taking these precautions, you can significantly reduce your risk.

