1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Hosts file modification only works for the exact address.

Discussion in 'Windows XP' started by LordLastDay, Sep 30, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. LordLastDay

    LordLastDay Thread Starter

    Joined:
    Feb 3, 2005
    Messages:
    8
    For some reason when I modify "C:\WINDOWS\system32\drivers\etc\hosts" to bypass a DNS server it only works for that exact site.

    If I use it for "www.pagewithbrokenDNS.com" I can enter the main page using that just fine, but if I type "www.pagewithbrokenDNS.com/forum" it gives me the error page and tries to use the DNS for it.

    It works okay if I just copypaste the IP part every time but it's really tedious and most login things don't work (if any).

    I'm stumped.

    Help much appreciated!
     
  2. shinybeast

    shinybeast

    Joined:
    Sep 29, 2008
    Messages:
    513
    Not sure what your going for but that's why they came up with DNS, because you have to put every address you want to resolve in the hosts file and that got way too cumbersome.
     
  3. LordLastDay

    LordLastDay Thread Starter

    Joined:
    Feb 3, 2005
    Messages:
    8
    A friend of mine who owns a website had their DNS provider mess up things, and while trying to fix it they gave the instructions on how to modify the hosts file to see everything properly by just using the IP.

    I asked them if there was a way to use an asterix or such to make it apply to many sites, and they told me it should apply to the whole domain already and they have no idea how it only works for one page at a time for me.

    For me the problem is the one I just mentioned.

    I figured out that if one page has that problem to me then probably all of them have it, including ones Spybot S&D is trying to block by redirecting pages to 127.0.0.1.
     
  4. WhitPhil

    WhitPhil Gone but never forgotten Trusted Advisor

    Joined:
    Oct 4, 2000
    Messages:
    8,684
    The syntax of the HOSTS file is {ip address} {Site URL}

    You can not resolve IPs at the "page" level.
     
  5. LordLastDay

    LordLastDay Thread Starter

    Joined:
    Feb 3, 2005
    Messages:
    8
    Yeah.

    That's why I'm so confused by it.
     
  6. WhitPhil

    WhitPhil Gone but never forgotten Trusted Advisor

    Joined:
    Oct 4, 2000
    Messages:
    8,684
    Sorry. Confused by what?
    The hosts file resolution is working exactly the way it is supposed to.
     
  7. LordLastDay

    LordLastDay Thread Starter

    Joined:
    Feb 3, 2005
    Messages:
    8
    What I mean is if I'd add this in the hosts file:

    ipaddressofthesitehere www.thisisanexamplesite.com
    ipaddressofthesitehere thisisanexamplesite.com

    According to my friends it should also work for:
    www.thisisanexamplesite.com/about
    thisisanexamplesite.com/forum
    www.thisisanexamplesite/whateverpage.php

    But for me it only works for the exact domain, none of those "/something" ones.

    Or are they just wrong and I'd have to add every single thread of the forum, their indexes, pages, and such, all on the same domain separately without my browser doing it for me?
     
  8. WhitPhil

    WhitPhil Gone but never forgotten Trusted Advisor

    Joined:
    Oct 4, 2000
    Messages:
    8,684
    Unfortunately your friends are incorrect.

    The HOSTS file is used to map {host names} to {ip addresses}

    If putting the type of syntax (www.hostname.com/pagename) is working for your friends, they have something installed other than the native XP facility.
     
  9. managed

    managed Trusted Advisor Spam Fighter

    Joined:
    May 24, 2003
    Messages:
    12,383
    First Name:
    Allan
    Why are you doing this ?
     
  10. LordLastDay

    LordLastDay Thread Starter

    Joined:
    Feb 3, 2005
    Messages:
    8
    When my friend's website's DNS server got messed up they told people add it's IP to the hosts file to access it while the DNS server is fixing their mistakes.

    But well, every time I clicked a link there it forwarded me to the "www.myfriendswebsite.com/something.php" (which doesn't work) instead of using "myfriendswebsitesIP/something.php" which works, so I had to highlight and copypaste the IP over the domain part every single time on the address bar.

    Incredibly tedious on a forum...

    It's more of an inconvenience thing that I thought was messed up, as apparently for other users they didn't have to copypaste the IP after just adding the domain once to the list.

    I was just wondering how I could fix that, but if you are telling that I just have to keep copypasting it every time or add every single thread to my hosts file then that's what I will do.

    Thank you for your help.
    I guess I'll just have to wait until they fix it.

    I'm sorry if I tried to fix something that isn't even broken. :eek:
     
  11. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Hosts file modification
  1. Robertico22
    Replies:
    8
    Views:
    650
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/754946

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice