Solved

Hosts File Redirect

Posted on 2010-08-26
5
494 Views
Last Modified: 2013-12-04
I know how to redirect single URL's to an IP address, but is there a way I can redirect ALL url's to a certain IP address from the hosts file?
0
Comment
Question by:XGenwareS
  • 2
  • 2
5 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 33538770
Probably not since the 'hosts' file is just a look up table for IP=URL pairs.  You would have to know all possible URLs.
0
 
LVL 2

Expert Comment

by:Nol888
ID: 33539042
The HOSTS file is an override of sorts for the Windows DNS system. Before sending a DNS request to your DNS server(s), it checks the hosts file to see if there's an entry for that hostname. By doing this, all requests to a given host are redirected to an IP. It is not URL specific at all.
0
 
LVL 2

Expert Comment

by:Pagefright
ID: 33539365
Try inserting the following line in the host file,

127.0.0.1 *
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 33539374
By the way the author worded the question, I thought he was using 'URL' as a synonym for hostname.  If he is, you can't put all possible hostnames in the 'hosts' file.  And since it is just a list, it won't redirect anything that isn't in the list.
0
 
LVL 2

Accepted Solution

by:
Nol888 earned 500 total points
ID: 33541262
>you can't put all possible hostnames in the 'hosts' file.
Absolutely correct. The HOSTS file doesn't support wildcards either, so he's pretty much out of luck.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Article by: btan
The intent is not to repeat what many has know about Ransomware but more to join its dots of what is it, who are the victims, why it exists, when and how we respond on infection. Lastly, sum up in a glance to share such information with more to help…
OfficeMate Freezes on login or does not load after login credentials are input.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

12 Experts available now in Live!

Get 1:1 Help Now