Solved

Hosts File Redirect

Posted on 2010-08-26
5
507 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 83

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 83

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Security measures require Windows be logged in using Standard User login (not Administrator).  Yet, sometimes an application has to be run “As Administrator” from a Standard User login.  This paper describes how to create a shortcut icon to launch a…
OfficeMate Freezes on login or does not load after login credentials are input.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

680 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