Solved

Hosts File Redirect

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Outsource Your Fax Infrastructure to the Cloud (And come out looking like an IT Hero!) Relative to the many demands on today’s IT teams, spending capital, time and resources to maintain physical fax servers and infrastructure is not a high priority.
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

932 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

14 Experts available now in Live!

Get 1:1 Help Now