locked
what is the role of hosts and lmhosts files? RRS feed

  • Question

  • I have win7 / XP domain computers and win2008 r2 domain controller.

    I am curious to know the role of hosts and lmhosts files in windows \system32\drivers\etc folder.

    Are these files used in DNS resolution or not?

    If not why do we still have them.

    ---shekhar-nsk

    Friday, January 9, 2015 8:13 AM

Answers

  • The hosts file on the client is actually always checked first. Makes sense to save bandwidth and reduce wait time.

    Also you might have multiple domains in corporate networks, which do not know each other and are not registered in your DNS server, but you may need to access a machine in another network accross boundaries. Hosts file comes in handy here. This would exactly describe the situation.

    Best greetings from Germany
    Olaf

    • Marked as answer by shekhar-nsk Tuesday, November 29, 2016 7:46 AM
    Tuesday, January 13, 2015 7:56 AM
    Moderator

All replies

  • Usually they do not play a role any more.

    But in certain situations, if you do not have working name resolution for a STATIC IP address, they can be used to supply the name resolution instead of a DNS server (hosts) or a WINS server/Broadcast for short NetBIOS names (lmhosts). This can also be used for devices, which do not support customization/registration of device names otherwise, i.e. you could add the IP address of an Internet capable TV and assign the name TV to it in lmhosts.

    So you could type ping tv instead of ping 192.168.2.222 or whatever its IP address would be.

    Best greetings from Germany
    Olaf

    Monday, January 12, 2015 3:53 PM
    Moderator
  • Thank you for the reply. 

    Does this mean that if the name is not resolved by DNS, these files are used 'EVERYTIME'? Can one not have an entry in DNS Servers  but only in hosts/LMhosts file and ensure that Name to IP address resolution is done?

    ANd in such cases, which files are used ? Those on DNS Servers or on the local host ?

    From :

    shekhar-nsk

    Tuesday, January 13, 2015 5:13 AM
  • The hosts file on the client is actually always checked first. Makes sense to save bandwidth and reduce wait time.

    Also you might have multiple domains in corporate networks, which do not know each other and are not registered in your DNS server, but you may need to access a machine in another network accross boundaries. Hosts file comes in handy here. This would exactly describe the situation.

    Best greetings from Germany
    Olaf

    • Marked as answer by shekhar-nsk Tuesday, November 29, 2016 7:46 AM
    Tuesday, January 13, 2015 7:56 AM
    Moderator