Solved

Windows 7 - Hosts file not redirecting website to IP address

Posted on 2013-01-07
29
738 Views
Last Modified: 2013-01-08
Hi,
I am trying to redirect my web browser to a specific IP address for my website during construction.
The content of my host files is shown below but I can't work out why its not working.

C:\Windows\System32\drivers\etc\hosts

123.456.56.232            www.mywebsite.com
123.456.56.232            mywebsite.com

If I open a command window in windows 7 and ping www.mywebsite.com it returns 123.456.56.232
So why won't my browser point to the location specified in hosts file?

Thanks in advance for your feedback..
0
Comment
Question by:sabecs
  • 9
  • 9
  • 9
  • +1
29 Comments
 
LVL 17

Expert Comment

by:selvol
ID: 38753212
Try clearing your cache?  

It's got to be something simple like that.

That should Absolutely point to  mywebsite.com
the way you have it written....


127.0.0.1  localhost

Selvol
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 38753213
To ensure the file is correct (using Windows 7 and UAC), open Notepad with Run as Administrator, navigate to C:\Windows\System32\drivers\etc\ and open Hosts . Make sure it is correct (make any changes) and click on Save.  Windows 7 need admin authority to change this file.

Try this and see if it works.

... Thinkpads_User
0
 
LVL 17

Expert Comment

by:selvol
ID: 38753217
THen try

0.0.0.0 google.com
0.0.0.0 www.google.com

And see if you can go to google.
0
 

Author Comment

by:sabecs
ID: 38753277
Thanks for your help, I have tried clearing cache, flushing dns, changing file as admin and added 0.0.0.0 google.com & 0.0.0.0 www.google.com to the file and I still get through to google. Same file works fine on another windows 7 PC, just wondering if wireless network can have anything to do with it?
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 38753283
Same file works fine on another windows 7 PC

Wireless should have nothing to do with it. It is just another form of TCP/IP connection.

On the problem PC, disable AntiVirus and Firewall temporarily to see if that changes anything. Integrated AV suites sometimes stop more than is reasonable.

On the problem PC, reset Internet Explorer (Tools, Internet Options, Advanced and Reset). See if that helps. Also run iexplore -extoff to run in Safe Mode. See if that works as it could be an add-on.

If the above do not help, run System File Checker (SFC /SCANNOW). Allow to complete and restart.

.... Thinkpads_User
0
 

Author Comment

by:sabecs
ID: 38753487
Thanks again for your help, I have disabled antivirus and firewall, reset internet options, run System File Checker and tried have firefox as well as IE and Safari, still same issues?
0
 

Author Comment

by:sabecs
ID: 38753497
Hi, I just tried disconnecting my wireless and plugged Laptop into LAN and redirects work fine, so I guess it's got something to do with my wireless connection?
0
 
LVL 37

Assisted Solution

by:Neil Russell
Neil Russell earned 500 total points
ID: 38753755
Is this a HOME PC or in an office environment?
Could be that your wireless connection goes via a web filter or proxy server of some type. If thats the case your host file WILL NEVER change where it gets to as the proxy will look for the IP address from the name the browser sends to it.
0
 

Author Comment

by:sabecs
ID: 38754338
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 38754360
Try your laptop in a different location (that is, different wireless router) to see if that works. Wireless modems normally do not cause this type of problem but it is good to check.

Check for viruses and malware wtih online Malwarebytes.

Otherwise, given all the things you have tried, you probably should find a convenient time to back up the computer, format the hard drive and install Windows again.

.... Thinkpads_User
0
 
LVL 37

Accepted Solution

by:
Neil Russell earned 500 total points
ID: 38756252
AHhhhh!!! Its a 3G broadband connection!! Not WiFi in the normally accepted sense of the word.

In that case I was correct.  Most 3G broadband providers AUTOMATICALLY redirect ALL traffic through a proxy server. A proxy server will ALWAYS resolve the address it is using from the SITE NAME you send it. This bypasses ANY host file entries you can ever try and make.
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 38756286
@: sabecs - Check and see if your 3G uses a proxy server. Mine does not and uses my Hosts file just fine. If you are using a proxy server, then that explains it.

Please let us know. ... Thinkpads_User
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 38756315
Thats what i just said!
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 38756469
Thats what i just said!

Yes, I know. I was asking if perhaps it was not using a proxy server.

... Thinkpads_User
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:sabecs
ID: 38756757
How do I check to see if it uses a proxy server?
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 38756788
Neilar may know that. My own 3G (also 4G if the area permits) uses a double NAT. That interferes with VPN (which I solve by paying an upcharge), but it does not redirect by not using my Hosts file. I cannot tell on my on device because it does not appear to be using a proxy.

.... Thinkpads_User
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 38756811
Not 100% guaranteed acurate but as neer as you get. Just visit   http://www.lagado.com/proxy-test
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 38756921
I switched over to my 3G USB key.  From the above site:
-------------------------------
Proxy Test
This request appears NOT to have come via a proxy.
The request appears to have originated from ip address xx.198.4.117
--------------------------------

The IP address is my ISP

.... Thinkapds_User
0
 

Author Comment

by:sabecs
ID: 38756958
Thanks again for your help, tried link above and results below:.

Proxy Test
This request appears NOT to have come via a proxy.
The request appears to have originated from ip address x.44.166.xx
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 38756963
Back to an earlier post of mine, if nothing works, it may be necessary to re-install Windows at a convenient point.

... Thinkpads_User
0
 

Author Comment

by:sabecs
ID: 38756972
I don't see the point of re-installing Windows as it works fine with other wireless networks or wired connections, issue is only with https://www.optus.com.au/shop/Broadband/Modems-&-Tablets-Carousel/HUAWEI-E586OMB
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 38756974
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 38756988
It is 99% certainly an ISP proxy issue.  There are transparent proxies that will not show up in the tests i listed above But the symptons are exactly those.

Installing windows again would get you nowhere.

Find another computer, put in your wifi and test. You will find the result follows your wifi adapter.
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 38757003
I don't see the point of re-installing Windows

There is certainly no rush. That is why is used "convenient time". There may come another time when you need to re-install Windows anyway.

Otherwise, it is hard to say why your machine is not using your Hosts file. My Hosts file works even using the 3G device.

There are several Hosts files: hosts, hosts.sam, and possibly hosts.lm. Make sure you are using Hosts and make sure there is only one of them (that is, hosts with no extension).

.... Thinkpads_User
0
 

Author Comment

by:sabecs
ID: 38757024
Thanks again for your help, http://www.whatsmyip.org/more-info-about-you/  did not show any poxies either.

Is there any way I can force host file use from IE, Firefox, Opera or Safari?
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 38757027
Here is a teqnique for testing for most transparent proxies. Give it a try.

http://tracetcp.sourceforge.net/usage_proxy.html
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 38757032
If its a proxy of any type you will Never be using the hosts file ever and you cant change that.
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 38757066
Read the following...

http://delimiter.com.au/2011/07/04/optus-filter-can-be-defeated-by-trivial-dns-change/

That tells us that Optus use web filtering. To use web filtering there has to be a proxy. As your device is on the Optus network........
0
 

Author Comment

by:sabecs
ID: 38757234
Thanks again to everyone for your comments.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Why does Windows lose the drive letter on removable drives? 8 53
prezi for presentation 2 44
Oracle VM ware 7 42
Mapped Network Drive Multiplying - Windows 7 - 64 Bit 6 30
You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now