hosts and lmhosts

Page 1 of 5 123 ... LastLast

  1. Posts : 37
    7 home premium 64-bit
       #1

    hosts and lmhosts


    if i add an entry into the hosts file, shouldn't it stop me from trying to access that webpage? i'm also wondering, how to lookup the ip address of pages i visit, or servers i connect to so i can prepare similar file configurations to hosts and firewall settings.
      My Computer


  2. Posts : 7,878
    Windows 7 Ultimate x64
       #2

    if you put an entry in a hosts file, the computer will NOT stop you from accessing the webpage, but rather will always use the IP address that you put into the hosts file. It's like writing down a phone number in an address book. If you ALWAYS use your address book, and never use the phone book (DNS), then you will always believe the phone number from your address book is the right number.

    As far as looking up pages you visit, go to a command prompt and type, ping Google. And it will respond with an IP address of a google server. However, be advised that many big web services and such have tons and tons of machines that serve up their web pages. So, hard coding a specific server for a site into a hosts file is not always a desirable action.
      My Computer


  3. Posts : 37
    7 home premium 64-bit
    Thread Starter
       #3

    so lmhosts.sam is a pain in the kilt-covered? I'm confused as to the hosts file (not lmhosts.sam). It seems to me that I should be putting MY IP address in place of 127.0.0.1. I have trouble with wording, and although a lot of information on the net says 127.0.0.1 is the loopback, I am unsure if the new ipv6 implementations have comprimised the integrity of an ipv4 loopback interface. I don't feel hosts is doing it's job tbh...I've read a few tutorials, and they all say the same thing but on this network I don't have to do anything technical in order to have to scratch my head and say, why is the screen glitching, what's the stall...

    I am near to say it's 2gb of memory, but it's ddr3 and a 2.8 ghx athlon II x2 220, not top of the line I know, but it shouldn't have trouble running several non graphics intensive programs side by side and after I configured the task scheduler, there was a lot of hang-up; I was trying to think of a way to make a really secure hardware firewall without coding, because I don't know code, and with 3rd party programs. For instance, the idea was to get defender running on a schedule, and anti-virus, to setup windows firewall appropriately, and just dedicate this small form factor machine to that purpose (it didn't meet the specifications for heavy rendering, although it meets the minimum specs, those should be raised!).

    that's the story short, and if you can't answer further, cool, thanks for your input. and of course, i was placing similar entries to hosts in restricted sites (like with spybot's hosts integration, and manual entries as I came across ad cookies, or research pages). It just doesn't seem sufficient enough. I'm almost sure it's something called wervault, or werfault? It is one of those stock programs that installed with Windows, I just can't finger the spelling, but the real issue is that just randomly blocking programs that sound funny, isn't working because it's always an issue with another service or program. Although the microsoft websites say a lot, they really don't place much emphasis on detail, except to say this is what the program does in the broadest spectrum. There is no cross reference for, these programs may implement the program wervault or whatever, these may implement it (with or without network connectivity), even again on a broad basis. So it's tough to nail down the system.
      My Computer


  4. Posts : 471
    W7 Professional x64
       #4

    Okay. So, as I've read through this, I'm afraid I've lost track of something somewhere along the line, so I was hoping to start with a simple question, and perhaps the answer to that will help us help you with the original question you asked.

    With this whole process you're doing, what exactly is your end goal? Are you trying to block websites, or something different?
      My Computer


  5. Posts : 37
    7 home premium 64-bit
    Thread Starter
       #5

    ...


    to prevent redirection to known malware addresses.
    i was under the impression that this is the purpose of the hosts file. and that's why it surprised me, that by entering ip's or domains on the list in conjunction with a local loopback point, IE will still allow users to navigate to those addresses. maybe this is a point of insecurity in IE, that it isn't monitoring it's own http redirection functions. and don't let me fool you into think i know the first thing about internet explorer besides knowing how to prompt for cookies.
      My Computer


  6. Posts : 5,642
    Windows 10 Pro (x64)
       #6

    Alright. I'll put it clearly as possible. The hosts file does not do what you think it does. The hosts file is a low tech version of an DNS. A DNS turns domain names, like google.com, yahoo.com into something a computer understands, IP addresses. That is what a hosts file does, its a DNS a very low tech DNS.
      My Computer


  7. Posts : 37
    7 home premium 64-bit
    Thread Starter
       #7

    lmhosts is from what i understand, but hosts i guess is supposed to (according to my reading) vary. providing the functionality of not permitting IE or other browsers redirect internet traffic to ip's or domains listed in the file, and instead (and this is where i'm confused) either redirecting them to a loopback point 127.0.0.1, or using the ip address on the file considered the loopback point to prevent redirection to a site, from that ip address.

    so

    127.0.0.1 doubleclick.net 0.0.0.0

    in the hosts file says don't let doubleclick.net from 0.0.0.0 redirect traffice originating from 127.0.0.1

    127.0.0.1 is supposed to be the localhost, and that's why i got confused as to whether i should input my ip address instead of 127.0.0.1. i understand what lmhosts does more or less, it registers ip's to websites. there are two troubles i see with it though, one being that dynamically assigned ip's seems to be all the craze so constant updating of that file would be annoying as all heck without a range of generic addresses for a page. and secondly i don't know if lack of having an lmhosts.sam file means that if i did have 128.6.4.32 suchandsuch.net (and that might be correct syntax but assume it were for an lmhosts entry just to suffice as an albeit bad, example), then does lmhosts.sam not tell me via an internet explorer prompt that website is trying to redirect traffic? i guess I should try it out. the problem is i don't have any means of testing it out....nor do I really want to.

    to revert, the hosts file preventing traffic redirect doesn't sound like it should work without using my ip address, or without having a loopback point that is listening to web traffic, i.e. another machine for sandboxing or some such. it's like goto statement harmful. i installed a program called hostess, to help manage the hosts file too. and i experimented and placed my ip into the 127 setting, when hostess did her thing of manicuring the hosts file into well name groups and categories, it only renamed some of the entries back to the 127 setting. i'm not sure why, but i also want to associate 127 with doubleclick.net.

    does that clarify my issue more?
    Last edited by colinearpsycho; 18 Apr 2011 at 14:25.
      My Computer


  8. Posts : 471
    W7 Professional x64
       #8

    colinearpsycho said:
    to revert, the hosts file preventing traffic redirect doesn't sound like it should work without using my ip address, or without having a loopback point that is listening to web traffic, i.e. another machine for sandboxing or some such. it's like goto statement harmful. i installed a program called hostess, to help manage the hosts file too. and i experimented and placed my ip into the 127 setting, when hostess did her thing of manicuring the hosts file into well name groups and categories, it only renamed some of the entries back to the 127 setting. i'm not sure why, but i also want to associate 127 with doubleclick.net.

    does that clarify my issue more?
    The hosts file isn't designed to prevent anything. The host file is a very very basic DNS function. Mainly, it just specifies a loop back address. Now, I'm almost afraid to ask, but why would you want to specify that your loopback address points to doubleclick.net? That probably would just break things... not to mention sending you to doubleclick.net.

    Personally, I'd say install Antivirus, a Firewall, and just leave the poor host file alone. It really isn't designed to do what you're trying to do, if I'm even understanding it correctly.
      My Computer


  9. Posts : 7,878
    Windows 7 Ultimate x64
       #9

    What happens with a host file and malware, is that some malware will PUT entries into a hosts file so that your computer goes to whatever site "THEY" want you to go to, versus the legitimate site that DNS would direct you to.
      My Computer


  10. Posts : 2,528
    Windows 7 x64 Ultimate
       #10

    colinearpsycho said:
    so

    127.0.0.1 doubleclick.net 0.0.0.0

    in the hosts file says don't let doubleclick.net from 0.0.0.0 redirect traffice originating from 127.0.0.1
    1) lmhosts is for windows networking only so forget about that, hosts is for the internet

    2) You sort of have it backwards. Your entry above means that when your computer tries to look up the address of "doubleclick.net" it will use 127.0.0.1 instead of the actual address.

    So yes you can block sites that way.

    OR if you find that for some reason your DNS server is returning bad addresses for say Google you can put in something like

    www.google.com 74.125.224.171

    And instead of using DNS it will use that known good address for google.

    BUT!

    If you have a virus or something that is redirecting your lookups locally then the hosts file maynever get used or as mentione above even rewritten in order to cause the redirection...

    The hosts file is most useful for two things. Blocking a web site by NAME (not number). or if your DNS is out or bad or some other reason, entering entries by hand...
      My Computer


 
Page 1 of 5 123 ... LastLast

  Related Discussions
Our Sites
Site Links
About 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 19:22.
Find Us