Link to home
Start Free TrialLog in
Avatar of Bill H
Bill H

asked on

Redirect Website using DNS

Hey guys,

We need to redirect a public website (say for ex. yahoo.com) to a different website. I tried doing this via CNAME record in my 2008 DNS server but it didnt seem to work right. Any help?
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

DNS can't redirect (change the name typed into the address bar in a browser), you need a web server to do that.

Do you have a web server you can bounce the request through?

Chris
Hello

You can't do that in that way. The Cname can be used as an alias for a web site (ex you type yaho and your browser go to www.yahoo.com)

If you want to filter things you need a proxy server, like ISA server.

Dan
ASKER CERTIFIED SOLUTION
Avatar of Rich Weissler
Rich Weissler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of noci
noci

with a CNAME (or alternate A RR) you can impersonate a site. The server needs to understand the hostname sent to it as the name that is typed by the user...
so if you want to handle yahoo.com then with something like
                yahoo.com CNAME yourserver.com

then yourserver needs to be able to handle yahoo.com (as yahoo.com is mentioned in the http request).
To capture the information in transit you need to setup a transparant proxy (so the browser doesn't (need to) know there is a proxy)
squid can help, but needs something that will redirect traffic through it.
if the alternate DNS record don't work, check if you use a proxy ... because then the proxy resolves the ip to the name and often the proxy points to external dns-servers ...
Avatar of Bill H

ASKER

thanks guys! in the HOSTS file can i redirect a website to a local file path on my pc?

say localhost\server\testwebpage.html
The host file can be loaded before all DNS research. So you can say:
www.yahoo.com 10.0.0.1
where 10.0.0.1 is the IP adresse of your internet server.

But this file can be edited by all admin users, unles a GPO rewrite the correct version on each reboot.

Dan
The hosts file doesn't redirect either, it does what DNS does: points a name at an IP address.

The server on the other side must be willing to answer the request for whatever name you originally use.

If that's what you intend then it'd be best going back to your question, what about it didn't work right?

Chris
your webserver also needs to be configured to accept any name or your example of yahoo.com
In case to your own pc use the address 127.0.0.1
> thanks guys! in the HOSTS file can i redirect a website to a local file path on my pc?
> say localhost\server\testwebpage.html

NO, this is not so simple.
While you call http://externalservername/file.html for the a file at a webserver your local filesystem dont answer to http:// . a Redirect to file://localhost/file.html is not possible from the hostfile.

You Need a local webserver, and a local dns overwrite (via Hosts-file) to Redirect the request to your local ressource.
But if your browser uses a Proxy, the local name-Resolution is not used.