Redirect Website using DNS

Hey guys,

We need to redirect a public website (say for ex. 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?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris DentPowerShell DeveloperCommented:
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?


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

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

Rich WeisslerProfessional Troublemaker^h^h^h^h^hshooterCommented:
What you describe is used to "Sinkhole" domains.  Basically, you'd treat as a hostile domain... and configure your local DNS server to tell it's client that it's authoritative for that domain.  You'll want to read more about Sinkhole DNS and DNS Blackholes.  

For the purpose you define, a good proxy server is a better idea.  Unfortunately ISA Server became Forefront Threat Management Server, and the Forefront Threat Management Server is a discontinued product.  One possible (and free) web proxy I've used in the past with some success has been Squid, if you decide to go down the proxy direction.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

nociSoftware EngineerCommented:
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 then with something like

then yourserver needs to be able to handle (as 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.
Dirk KotteSECommented:
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 ...
Cobra25Author Commented:
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:
where 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.

Chris DentPowerShell DeveloperCommented:
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?

nociSoftware EngineerCommented:
your webserver also needs to be configured to accept any name or your example of
In case to your own pc use the address
Dirk KotteSECommented:
> 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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.