I was just wondering, I keep on seeing other posts telling them to either modify hosts/lmhosts/*.sam files. What are these files for, I know they're for networking for windows, but what exactly are they? I', just very curious..

Recommended Answers

All 2 Replies

The hosts file has it's origins in UNIX. Basically, if you don't have a local DNS server on your network and want to be able to access/ping/etc. other machines by hostname instead of using their IP, you can edit your hosts file and manually add the entries, so name resolution works without a DNS server.

Example hosts file:

# This is my example hosts file.
# I only have 3 machines on my tiny home network..
192.168.0.5 Machine1_hostname
192.168.0.10 Machine2_hostname
192.168.0.15 Machine3_hostname

So now if you ping Machine2 from Machine1, name resolution will appear to take place.

You can also use the hosts file to block certain websites by making them resolve to localhost, which is useful for blocking ad sites (doubleclick, etc.):

127.0.0.1 ads1.doubleclick.net
127.0.0.1 doubleclick.net

and so on. Keep in mind that this is a very simplistic example. Try doing a search on Google for more in-depth examples/tutorials.

Thanks...

and so on. Keep in mind that this is a very simplistic example. Try doing a search on Google for more in-depth examples/tutorials.

I'll do this...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.