Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: hosts and lmhosts

19 Apr 2011   #21
SledgeDG

Windows 7 Ultimate x86
 
 

Google can't have any 10.x.x.x-address those are private addresses like the notorious 192.168.x.x and thus not routable

Check this out: http://tools.ietf.org/html/rfc1918


My System SpecsSystem Spec
.
19 Apr 2011   #22
pparks1

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by SledgeDG View Post
Google can't have any 10.x.x.x-address those are private addresses like the notorious 192.168.x.x and thus not routable

Check this out: RFC 1918 - Address Allocation for Private Internets
For Pete's sake, I realize this. It was simply put as an example. If he puts in 10.something into the hosts file and then pings and it resolves 10.something then he knows the host file is working as expected and DNS is not taking over.
My System SpecsSystem Spec
19 Apr 2011   #23
colinearpsycho

7 home premium 64-bit
 
 

@pparks1

i didn't understand your last answer parks. i didn't catch the example either, but no harm no foul. but you have me confused insofar as dns taking over, i thought dns and hosts are playing on the same team? do you mean to say that in regard to the suggestion that there is some server side confusion with name resolution that was made earlier? excuse me, i'm not slow but the whole playing the middle diddle puts me in kilts.
My System SpecsSystem Spec
.

19 Apr 2011   #24
WebMattR

W7 Professional x64
 
 

You open a web browser, and type in www.sevenforums.com. The following is a simplification of what occurs:

Your machine looks at hosts file.
It doesn't find 7F.
It then sends a query to a DNS server.
The DNS server searches until it finds 7F.
It transmits the required information to your web browser, and you are sent to the page.

Does that help?
My System SpecsSystem Spec
19 Apr 2011   #25
pparks1

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by colinearpsycho View Post
i didn't understand your last answer parks. i didn't catch the example either, but no harm no foul. but you have me confused insofar as dns taking over,
If you don't have anything in your hosts file, your computer will look up the answer via a DNS server. If you have an entry for the address in question in the hosts file, it will use that.


Quote   Quote: Originally Posted by colinearpsycho View Post
i thought dns and hosts are playing on the same team?
DNS and hosts files do the same thing. 1 is centralized and available on the Internet for everybody to use, and one is local on your own computer that only you can use. And your computer will use an entry in the local hosts file, if 1 exists.
My System SpecsSystem Spec
19 Apr 2011   #26
Jacee
Microsoft MVP

Windows 7 Ultimate 32bit SP1
 
 

This is about DNS cache poisoning and redirects DNS cache poisoning - Wikipedia, the free encyclopedia

This is about the Hosts file and DNS
Hosts (file) - Wikipedia, the free encyclopedia

See the faq and add a good Hosts file http://msmvps.com/blogs/hostsnews/default.aspx
My System SpecsSystem Spec
19 Apr 2011   #27
colinearpsycho

7 home premium 64-bit
 
 

hahaha, everyone is quite fixated on the hosts file, but the discussion is about the hosts and lmhosts files. i understand the process of the hosts file, i was trying to clarify what parks was saying because it conflicted with previous answers, and the use of syntax has bounced back and forth through replies so i need to catch up on which file repliers are referring to; so that the confusion is minimal and things don't get heated in discussion & then I become lost. apologies.

this shouldn't defer the topic, would using a proxy software like squid or tor help? tor seems to bounce your connection location data around to hide your surfing, and presumedly squid performs the exact same action, but all this talk about dns servers has me wondering if squid-cache, you see, doesn't lend to that function.

and then of course, your help is appreciated, but it doesn't help to have ms windows saying different things about hosts than the common suggestion says or other websites. wikias tend to be user interactive, which doesn't take away from their validity but it might diminish the clarity of logic. wikipedia and hosts say the same thing, but you have to admit that the mapping of addresses seems more pertinent to lmhosts, and with programs like spybot offering hosts files, msvps.org, or gorilla, stevere martin; etc. also providing hosts files which are meant as redirect entries in the hosts file, the mapping term is confusing. so i guess that means that as for the hosts file itself, i don't have to simply provide a redirect like 127.0.0.1 or 0.0.0.0 i could place accurate entries like #.#.#.# example.com which are actual address/domain combinations and it would still be correct use of the hosts.file file. so why are there hosts and lmhosts files?
My System SpecsSystem Spec
19 Apr 2011   #28
pparks1

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by colinearpsycho View Post
hahaha, everyone is quite fixated on the hosts file, but the discussion is about the hosts and lmhosts files.
Do you now understand what the lmhosts file does. It's for netbios names on a Microsoft based network, either workgroup based on domain based. For example, I I could have 4 machines on the network, named "fish", "pony", "horse", and "donkey". These would ALL be the lmhosts names of these machines. So, if I wanted to access a share from any of them, I would look for their name in Network places to locate the share. But, I might run 4 websites off each of these. Perhaps "fish" hosts www.fishtanksRcool.com, and "pony" hosts www.poniesarecool.com, and "horse" hosts Horseplay.com! and finally "donkey" hosts www.donkeypunch.com". So, these fully qualified domain names would be controlled by DNS or by the hosts file.

Quote   Quote: Originally Posted by colinearpsycho View Post
this shouldn't defer the topic, would using a proxy software like squid or tor help?
Help to do what, what are you trying to accomplish?

Quote   Quote: Originally Posted by colinearpsycho View Post
so why are there hosts and lmhosts files?
Please see my answer above. The lmhosts is a lan manager hosts file. It maps netbios names on a microsoft based network. The hosts file is a hosts file and it does fully qualified domain names to IP addresses. The hosts file is like a small manually controlled copy of DNS that you put right on your own computer. But unlike DNS, you have to maintain it and know about any and all changes.

hosts and lmhosts is kinda like engines versus motors. 1 of them runs on gasoline or diesel fuel, and 1 of them runs on battery power. Both can be placed into a car allowing you to go from point A to point B. And on the Internet, you will find people that talk about the motor in their car...when in fact it's an engine. And you might find somebody discussing the engine in the radio control car, when in reality it's a motor.
My System SpecsSystem Spec
19 Apr 2011   #29
colinearpsycho

7 home premium 64-bit
 
 

motors accrue mileage. engines run horsepower.

i guess that puts the two in perspective whether or not you meant to, although it's and i hate to say it, hardly from understanding a straight forward bit. lots of run around.

mileage being that hosts adds a mile (sends traffic back to loopback point) everytime x amount of feet (an ip) is reached.

the engine has x amount of pistons (domains) that translate into horsepower (ip's) <--- that ones kind of off i know. beats trying to figure out the analytical engine...

and the thing to note about when i changed my hosts.file file is this was a few days ago and it was for a brief time so (also i've reloaded the os), hopefully minimal damage happened in that period.

hosts.file is understood well enough now, and i hate being redundant so shame on me for asking: 127.0.0.1 or 0.0.0.0 or x.x.x.x is a loopback point

0.0.0.0

and it sends badwebsite.com queries to this loopback point to prevent communication reaching and data traversing to and from badwebsite.com

0.0.0.0 badwebsite.com

the real question has yet to be answered though, why doesn't an entry being made in the hosts.file file then, not prevent traffic to badwebsite.com. as stated, i placed a website on the hosts.file file in proper syntax, having (and this wasn't mentioned) 127.0.0.1 localhost NOT commented out (meaning having no comment characters before the line), yet when I entered the address into the IE address bar, traffic still went to the webpage. unless there are replications of the website so that it knows if my hosts says don't go there, go here it's the same thing with a different address but how is stupid is so stupid does going to know?

i do understand the lmhosts file now. i just don't see the purpose and that's only because I don't well understand the preload and domain functions yet. according to the file they don't serve as comments. there is no need to go into that matter here, I just want to clarify the precise roles and faults of these two files, aside from being goto statements.

thanks for all your help, sort of
My System SpecsSystem Spec
19 Apr 2011   #30
pparks1

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by colinearpsycho View Post
hosts.file is understood well enough now, and i hate being redundant so shame on me for asking: 127.0.0.1 or 0.0.0.0 or x.x.x.x is a loopback point
The ONLY address that is a loopback address is 127.0.0.1 and that means, "THIS HOST".


Quote   Quote: Originally Posted by colinearpsycho View Post
0.0.0.0 badwebsite.com

the real question has yet to be answered though, why doesn't an entry being made in the hosts.file file then, not prevent traffic to badwebsite.com.
If you put that entry into a HOSTS file, it WOULD prevent you from accessing badwebsite because you would only look to 0.0.0.0 to find it...which of course it isn't there. In fact, you could practically set it to any address other than it's actual address and you would PREVENT yourself from accessing the site.


Quote   Quote: Originally Posted by colinearpsycho View Post
as stated, i placed a website on the hosts.file file in proper syntax, having (and this wasn't mentioned) 127.0.0.1 localhost NOT commented out (meaning having no comment characters before the line), yet when I entered the address into the IE address bar, traffic still went to the webpage.
You must have done it wrong. Try this, put this line into hosts
Code:
68.42.10.10 www.google.com
Now, open up a command line, type:
Code:
ping www.google.com
. It better respond with 68.42.10.10. Now, open your web browser. Type in :
Quote:
It should NOT open google.com unless I get horendously unlucky and 68.42.10.10 is in fact google.



Quote   Quote: Originally Posted by colinearpsycho View Post
i do understand the lmhosts file now. i just don't see the purpose
That's because there practically is NO purpose for LMHOSTS these days. It was used like 15 years ago when Windows workgroups and such weren't using DNS for name resolution. Everything more or less uses DNS or hosts files these days to accomplish the same thing that lmhosts used to do in a Windows environment. Like I said, other Operating Systems like Linux or OSX don't even use LMHOSTS files. I haven't used an lmhosts file or worked with WINS in a number of years now. It's all handled in DNS and when DNS isn't the answer, a HOSTS file.
My System SpecsSystem Spec
Reply

 hosts and lmhosts




Thread Tools




Similar help and support threads
Thread Forum
Hosts file ignored and replaced with hosts.original
Hello. I am trying to use the hosts file. However both pings and web addresses still bypass the hosts file. I noticed that there is another file in the C:\Windows\System32\drivers\etc directory called 'hosts.original'. When ever I delete this file, it reappears seconds later. I have made sure that...
General Discussion
Hosts.txt or hosts.sys
in the drivers/etc folder is: hosts.txt and hosts.sys. I want to edit the hosts file but i dont know is it hosts.txt Or hosts.sys. Oh, theres a file called Hosts without extension on my diffrent pc too. Can you tell me is it safe to edit hosts file as well? The hosts file witout extension...
General Discussion
Hosts file-S??
can the hosts file be changed to, or amended by, another file? IOW can there be a file named xyz that essentially replaces the hosts file, or adds entries to it? Possibly by a registry key or configuration setting? Of course it could by altering library fxns, but by other "simpler" means? ...
System Security
hosts...again...but differed
i put some of the network computers on my hosts list, to try and circumvent some issues and lost internet connectivity. none of the ip addresses are listed as the subnet, default gateway; etc. they were just ip's of other computers that connect to this network at times. why did that happen? is it...
Network & Sharing
HOSTS File - Create a "Edit HOSTS file" Shortcut
How to Create a "Edit HOSTS file" Shortcut in Windows 7 and Vista The HOSTS file is a .txt file used in Vista and Windows 7 to map hostnames to IP addresses. Your computer checks this file first to resolve any network names to its corresponding IP address before it tries to check the Internet....
Tutorials
HOSTS file
I setup a hosts file in windows xp in order to use my website locally using the exact domain name by editing the hosts file by adding the line: 127.0.0.1 www.test.com This should resolve my local ip address for the test.com site and if apache is running, then it should load the website...
Network & Sharing


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 05:10.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App