Hosts File

Page 1 of 4 123 ... LastLast

  1. Posts : 418
    N/A
       #1

    Hosts File


    Hey,
    I was wondering, is there any internet performance gain if you put a commonly used website's IP (like Google) in your Hosts file, so it doesn't need to ask a DNS server? I mean, because I have 30 websites I go on at least 10 times each day, and it lags when I open all of them

    Thanks!
      My Computer


  2. Posts : 22,814
    W 7 64-bit Ultimate
       #2

    Perhaps I'm not understanding your question, the Hosts File blocks web-sites.


      My Computer


  3. Posts : 418
    N/A
    Thread Starter
       #3

    Nope. Many people use the Hosts file to block websites by redirecting them to 127.0.0.1, which redirects to localhost, going nowhere.
    When the browser contacts a DNS server to find the IP, I'm using the Hosts file to remove that action. Google's IP is 173.194.75.94. I can enter "google.ca 173.194.75.94" in the Hosts file, and my browser won't need to contact a DNS server to fetch the IP, thus speeding up the loading process.

    However, this is just an assumption. I need this to be verified.
    Also, I know that there is the risk of a website's IP being changed

    But thanks for helping.
      My Computer


  4. Posts : 418
    N/A
    Thread Starter
       #4

    See, Wikipedia says that Hosts files are used to "map hostnames to IP addresses". It can be used to map any website to a non-functioning IP address, in this case 127.0.0.0, but it can also be used to map the proper address
      My Computer


  5. Posts : 22,814
    W 7 64-bit Ultimate
       #5

    Helping is my pleasure mate, I learn that way too.


    I'm not sure if using the Hosts File that way would work for what you want or not, though one thing I know is some sites have sever IP and that may cause issues and make it more trouble than it's worth.
      My Computer


  6. Posts : 418
    N/A
    Thread Starter
       #6

    Yeah...that's slightly problematic...
      My Computer


  7. Posts : 742
    MS Windows 7 Ultimate 64-bit SP1
       #7

    Instead of tinkering with hosts file, save the frequently used websites in to bookmarks in your browser and change the url to it's IP address in the bookmark properties. But I don't think you're going to save a lot of time in opening the websites.

    You would be better off requesting your ISP for another DNS server's addresses.
      My Computer


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

    Windows already caches DNS records when you use them. So no adding them to the hosts file will not help any.
    Open a Command Prompt and type "ipconfig /displaydns" that will show you all the entries that are cached.
      My Computer


  9. Posts : 4,049
    W7 Ultimate SP1, LM19.2 MATE, W10 Home 1703, W10 Pro 1703 VM, #All 64 bit
       #9

    You can but ...


    Injust said:
    Hey,
    I was wondering, is there any internet performance gain if you put a commonly used website's IP (like Google) in your Hosts file, so it doesn't need to ask a DNS server? I mean, because I have 30 websites I go on at least 10 times each day, and it lags when I open all of them
    You can put any sites you want in your Hosts file, but I'm not sure how much performance benefit there would be.

    Bare Foot Kid said:
    Perhaps I'm not understanding your question, the Hosts File blocks web-sites.
    IIRC, before DNS servers you had to put sites in your Hosts file (for name resolution).

    You can use it to:

    • Replace a DNS request
    • Block a website.

    The entries don't even have to be "real" sites.

    In my networking course, we had to add a "fake" site the Hosts file, because the TAFE campus doesn't allow students to modify their DNS server.
    The "fake" site was a dummy website that we had created on a virtual server.

    logicearth said:
    Windows already caches DNS records when you use them. So no adding them to the hosts file will not help any.
    Open a Command Prompt and type "ipconfig /displaydns" that will show you all the entries that are cached.
    It would stop the first DNS request being sent though (i.e. they won't be forgotten when you shutdown). :)
      My Computer


  10. Posts : 418
    N/A
    Thread Starter
       #10

    logicearth said:
    Windows already caches DNS records when you use them. So no adding them to the hosts file will not help any.
    Open a Command Prompt and type "ipconfig /displaydns" that will show you all the entries that are cached.
    BTW, when I enter ipconfig /displaydns in CMD, this comes up :P
    Attached Thumbnails Attached Thumbnails Hosts File-cmd.png  
      My Computer


 
Page 1 of 4 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 23:46.
Find Us