What is the difference between hosts and lmhosts files?
Windows – the difference between hosts and lmhosts files
domain-name-systemwindows
Related Topic
- The difference between DNS alias name and primary DNS suffix
- Windows – NTFS ACL’s: What is the difference between object and container inhertiance
- Hostname vs FQDN – Difference Between Hostname and Fully Qualified Domain Name
- Difference Between DOMAIN\username and username@domain.com – Windows Active Directory
- Windows – the difference between “Main” mode and “Quick” mode when using IPsec in Windows Server
- Difference between Host record and A record
Best Answer
The letters "LM"? >smile<
The "HOSTS" file contains entries that simulate "A" records in DNS (and PTR records, too). Only DNS-legal names are allowed in this file.
The "LMHOSTS" file contains entries that simulate NetBIOS name resolution responses (and they have a baroque little mini-language to let you preload entries into the NetBIOS name resolution cache, specify domain entries, and include other files). Only NetBIOS-legal names are allowed in this file.
Name resolution APIs are a little muddled in Windows. It's possible for an application to make a DNS resolution request only (in which case the HOSTS file would return a result if such an entry existed), or to make a different call that can end up querying both files (via a NetBIOS and DNS name lookup). There are some nasty fiddly bits about resolution provider order that we actually worried about back in the Windows NT 4.0 days but, thankfully, have passed out of my regular use (and thus my memory).
BTW: It's 2009-- don't use either one of them for anything in a production network. It sounds harsh, but it's the truth. When you say "Gee-- I have a problem and I think I'll solve it with a HOSTS file", all you've done is create another problem.