1

I current have a single server running at home. I use freedns.afraid.org to route the domain name to my current ip.

I wish to setup an additional server on a separate domain. How best to achieve it so:

domain1.com -> DDNS -> current ip -> DD-WRT -> server 1

and

domain2.com -> DDNS -> current ip -> DD-WRT -> server 2

for all ports (http, ssh, ftp etc.)

3
  • 1
    HTTP has a "Host header" so when you http to domain1.com or domain2.com even when it converts to an IP the host that the client HTTPd to is still stored, stored in that header. It may not be possible though with the other protocols 'cos I'm not aware of them having anything like that.
    – barlop
    Jul 8, 2015 at 12:29
  • Also even then.. Even with HTTP, The NAT router isn't going to port forward choosing one server over another, based on a host header. So, you have to distinguish which server the NAT router forwards to, based on port.
    – barlop
    Jul 8, 2015 at 12:41
  • And so re HTTP, it'd still reach the same server, regardless of host header. Though that server could then be more selective about what content it shows, depending on the host header.
    – barlop
    Jul 8, 2015 at 12:49

3 Answers 3

3

You can't quite do this for most services. However you can come close.

  • Make your two domains CNAMEs for the DDNS domain. One could be your DDNS domain.
  • Port forward services that are unique to one domain to the appropriate server.
  • Port forward services to one server for shared services to one server, and proxy requests for the other domain to the other server. This will work for HTTP/HTTPS, SMTP (relay), and other protocols.
  • If you really need direct access to specific services on both servers, you will need to forward a non-standard port to one of servers.
1

You can’t. Except for HTTP, which provides the host name to the server (or reverse proxy or whatever), other protocols rely purely on IP address and port to identify the endpoint.

So you need to get an additional IP or use different ports.

1

Pretty sure the only way to achieve this is to request a 2nd IP from your ISP.

Reason being that you are wanting to forward all ports to two different machines. This isn't possible. The only possible work around with one IP would be to assign one server it's ports like http to 80, SMTP to 25, ftp to 21/22, etc. and the other server to respond to those same protocols on their non standard ports like http at port 8080, ftp at port 2121. In so on and so forth.

It's much cleaner getting two IPs from your ISP rather then trying to remember special port bindings on non standard ports. And, it also lets you connect to ALL ports, not just some.

Each ISP varies but my local cable co (Bright House) charges 10 extra a month for an additional IP.

You must log in to answer this question.

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