i have a linux box that has 2 NICs, it serves as a firewall/router with red NIC connected to public static IP and green NIC to a switch, and then i have 3 servers connected to the switch that run multiple VMs with Bridged networking, so they have IP leases as if they were "physically" part of the network.
i also have multiple domain names registered, say example1.com and example2.com im wondering if its possible, and if so how can it be done, to redirect traffic to a specific internal IP based on domain name... so say the two domain names are mapped by my DNS provider to my one and only public ip, but i have multiple servers and services i want mapped to specific domain... so whenever i get a request with domain name example1.com my router will forward that traffic to the internal server behind it...
so basically i can map multiple domains to a single public ip, but i have many local IPs that can be assigned to the domain
something like 192.168.1.101 example1.com 192.168.1.102 example2.com
i know such a scenario is possible with apache2 and virtual hosts because the HTTP header includes the domain name but would i need to have a DNS setup on the firewall in order to translate domain name to internal IP... basically VPS hosting