Ubuntu – Redirect traffic from a single domain to another webserver using Bind9 and ufw

apache-2.2binddomain-name-systemUbuntuufw

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.

Best Answer

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.

Related Topic