Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I host my own DNS server and would like to be able to redirect links from within the DNS server so that redirection is seamless.

Example: redirect all requests for www.yahoo.com to www.google.com. I'd like to rewrite the parameters as well.

IE: www.yahoo.com?search=asdf --> www.google.com?q=asdf

Is this better done through a proxy server? I want to minimize the amount of custom configuration that must be done at the router level and put all the logic into the my DNS (or proxy) server.

Thank you

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

This is not something you can do with DNS. If you host the domain you want to redirect then Apache+Mod-rewrite would be my suggestion, if not, then a Squid proxy would be how I'd tackle the problem.

Bart.

share|improve this answer
    
Both are good suggestions. –  mcandre Jun 21 '10 at 16:06
    
Thanks, Bart. Is it possible to redirect traffic through a proxy server at the router level (say a cheap linksys or netgear)? I'd like to not have to configure each client browser individually. –  Jackson Jun 21 '10 at 16:28
1  
You can put the proxy inline with the router or use DHCP to set it as the default gateway. Do a search on "Transparent Proxy" for other suggestions on how to do this. –  matthew Jun 21 '10 at 17:05
add comment

You can have Bind return a zone record that points to your server (named.conf):

zone "www.yahoo.com" {
    type master;
    file "/var/named/yahoo.com.db";
};

/var/named/yahoo.com.db :

 $TTL    604800
 *. IN  A   IPADDRESSOFYOURSERVERHERE

Then from your web server, you will have to create a DNS record that acts as yahoo.com. Once you have that, a simple apache redirect should be able to move all the traffic to google or wherever.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.