Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 521
  • Last Modified:

Hosts File Redirect

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
XGenwareS
Asked:
XGenwareS
  • 2
  • 2
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
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
 
Nol888Commented:
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
 
PagefrightCommented:
Try inserting the following line in the host file,

127.0.0.1 *
0
 
Dave BaldwinFixer of ProblemsCommented:
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
 
Nol888Commented:
>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

Put Machine Learning to Work--Protect Your Clients

Machine learning means Smarter Cybersecurity™ Solutions.
As technology continues to advance, managing and analyzing massive data sets just can’t be accomplished by humans alone. It requires huge amounts of memory and storage, as well as high-speed processing of the cloud.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now