Hosts file modification only works for the exact address.

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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!
 
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.
 

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.
 

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.
 

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.
 

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?
 

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.
 

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:
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Members online

Top