1

I have a DNS server setup with Bind9 and ufw as the firewall. ufw forwards all web traffic to our web server however I would like to redirect one domain to a different server.

Example Servers

  • DNS server IP: 121.55.44.101 (10.0.0.1 internal)
  • Web server IP: (internal 10.0.0.80)
  • New server IP: (internal 10.0.0.75)

Example Domains

  • www.baskets.com.au (points to DNS server and forwarded to web server)
  • www.rollerblade.net (points to DNS server and forwarded to web server)
  • www.bananas.com.au (points to DNS server but would like it to redirect to the New server)

How do I go about doing this?

I have been messing around with Bind9, ufw, host files, apache redirects and can not get it working. Any help would be greatly appreciated.

5
  • 1
    You'll want to use HTTP redirects. What config have you tried in Apache? Sep 15, 2011 at 21:07
  • Is it possible to get another IP address outside on the DNS Server? Without that you will not be able to use port 80. HTTP vhosts use a header in the HTTP request, and you will not be able to intercept it with bind or UFW. IF you can bind a secondary public IP address to the DNS server outside, then you can NAT that over to the new internal. If you cannot do that, and you don't mind using the existing web server, you can use Apache like a proxy to proxy the requests on that vhost over to the new server.
    – Doon
    Sep 15, 2011 at 21:18
  • @Shane Madden in apache I have set it up as a normal site and that has a php 301 redirect to the 121.55.44.101:81 which i have port forwarded in ufw to 10.0.0.75:80 this works but is very messy. I would like to be able to redirect www.bananas.com.au on the DNS server before it is send to the Web Server due to the port forward. Is there a way to redirect this before ufw touches it so to speak?
    – Craig
    Sep 16, 2011 at 0:15
  • @Doon what is required to setup the proxy to proxy with Apache?
    – Craig
    Sep 16, 2011 at 0:17
  • DNS doesn't speak HTTP, and cannot redirect an HTTP request. After re-reading your question, it looks like you're keeping one public IP and wanting to host sites from two different servers? If this is the case, you'll want to look into setting up your Apache as a reverse proxy as @Doon mentioned. Review reverse-proxy for some example configurations. Sep 16, 2011 at 0:42

1 Answer 1

1

As mentioned in the comments, without another IP address you can't do this at the DNS/router/firewall level.

You can do this at the http server level. You set this up using a reverse proxy. To do this using Apache you use mod_proxy.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .