Local name resolution: hosts files, DNS suffixes, mDNS, LLMNR and NetBIOS
In short: Before and after DNS, computers have other ways to find names on the local network: the hosts file, DNS suffixes added to short names, multicast DNS used by Apple, printers and smart devices, and the older Windows protocols LLMNR and NetBIOS. LLMNR and NetBIOS are easy to abuse, so many organisations turn them off and rely on DNS.
Why short names work
When you type \\fileserver or ping printer2, you are not using a full DNS name. The operating system tries several things in order until one answers.
The hosts file
A plain text file (C:\Windows\System32\drivers\etc\hosts or /etc/hosts) that maps names to addresses. It is checked before DNS on almost every system, so an old entry overrides everything. Malware sometimes edits it to redirect sites, and developers use it to test websites before changing DNS.
DNS search suffixes
For a short name like fileserver, the client adds its DNS suffixes in turn: fileserver.corp.example.com, then fileserver.example.com. The suffix list comes from DHCP (option 15 and 119), the Active Directory domain, or manual settings. Wrong or missing suffixes are a common reason a short name fails while the full name works.
Multicast DNS (mDNS)
mDNS lets devices answer for names ending in .local by multicasting to 224.0.0.251 (or FF02::FB) on UDP 5353, with no DNS server needed. Apple's Bonjour, AirPrint, AirPlay, Chromecast, many printers and smart devices use it together with DNS-SD for service discovery. Because multicast does not cross routers, devices on a different VLAN do not appear; enterprise networks use an mDNS gateway or proxy on the controller or router to share selected services between VLANs.
LLMNR and NetBIOS
If DNS fails, Windows has traditionally asked the whole local network with LLMNR (multicast on UDP 5355) and NetBIOS name service (broadcast on UDP 137): "does anyone know fileserv?" The problem is that any device can answer. Attack tools such as Responder wait for mistyped names, claim to be the server, and collect the user's password hash when Windows tries to log in. This is one of the most common findings in internal penetration tests.
The fix is to turn them off on managed devices and make sure DNS is reliable:
- LLMNR: Group Policy "Turn off multicast name resolution".
- NetBIOS over TCP/IP: disable through DHCP (Microsoft option 001 = 2) or adapter settings.
- Microsoft is phasing both out in newer Windows versions.
Troubleshooting a name
nslookup fileserverorResolve-DnsName fileserver: does DNS know it, and which suffix was used?ipconfig /all: check the DNS suffix search list.ping -a 10.10.5.20: reverse lookup from an address.- Check the hosts file for stale entries.
- For .local devices, check that the client and device are on the same VLAN or that an mDNS gateway is configured.
Real-world example: the penetration test finding
An internal penetration test at a company captured password hashes from several staff laptops within 20 minutes, simply by answering LLMNR and NetBIOS broadcasts for mistyped share names. Two of the hashes were cracked. Disabling LLMNR and NetBIOS through Group Policy and DHCP, plus enforcing SMB signing, closed the issue before the retest.
Practice
Which file can override DNS on almost every operating system?
Which protocol and port does multicast DNS use?
Why are LLMNR and NetBIOS name service considered risky?
Key takeaways
- The hosts file is checked before DNS and overrides it.
- DNS suffixes turn short names into full names; check the search list.
- mDNS (.local) powers discovery of printers and smart devices on one VLAN.
- Disable LLMNR and NetBIOS name service and rely on DNS.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.