Free tech learning for everyone, from basics to pro

Network FundamentalsNetworking SecurityIntermediate

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.

How Windows resolves a namehosts filechecked firstDNS cacherecent answersDNS serverswith suffixsearchLLMNR / mDNSask the locallinkNetBIOSlegacyfallback
Figure 1. If DNS fails, older fallback methods ask the whole local network, which attackers can answer.

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 fileserver or Resolve-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?
The hosts file.
Which protocol and port does multicast DNS use?
UDP 5353, to 224.0.0.251 or FF02::FB.
Why are LLMNR and NetBIOS name service considered risky?
Any device on the local network can answer their queries, letting attackers impersonate servers and capture credentials.

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.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
Mohamed Fayas
Role
Founder of FM TecHub
Credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

He writes practical, plain-English guides on networking, security and cloud.

More about the author →

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.

Email updates: coming soon

New notes, tools and security news from FM TecHub by email, explained simply. Free. We're not collecting email addresses yet; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesopening soon

Meanwhile, stay connected: