This may be fairly basic, so if it seems so please don't overthink it!
- Home server running Hyper-V with VMs for IIS, MSSQL, and others
- Residential connection with potentially shifting IP, which I've mapped to a DynDNS domain (so the DNS updates automatically)
- Server and all VMs (except one) are running Windows Server 2012
- Server hosting VMs is configured as a DNS server, and all VMs have both a static internal IP for the network (as well as a hostname -- my IIS VM, for example, is iis.mydomain.com)
- Server is behind a router, but can configure the usual (DMZ, port forwarding, etc)
I would like to be able to forward traffic on all ports for **.mydomain.com:PORT* to go to the appropriately mapped VM (i.e iis.mydomain.com:PORT --> IIS_VM:PORT), which maps to a specific static IP on my network.
For example, I hit iis.mydomain.com with RDP and it connects me to the IIS VM via Remote Desktop from external to the network. I hit iis.mydomain.com in the web browser and it loads the appropriate site which is bound to that hostname on the IIS VM.
Alternatively, with all the above being true, I could create mssql.mydoman.com and hit it via Remote Desktop, where it connects me to that VM. I could also hit it via Management Studio and have it connect.
- Set up nameservers which point to my residential IP (and are dynamically updated via DynDNS)
- Pointed mydomain.com to the above nameservers
- Using central server that is running DNS to resolve hostnames on the network
I can hit iis.mydomain.com from outside my network and it does resolve an IP -- unfortunately it resolves 192.168.0.105, which is the internal IP of the IIS machine. This makes sense because in the DNS manager that's what I've assigned to the hostname.
So, the question:
How do I configure my DNS server (or re-configure my current setup) such that internal to the network the traffic is correctly forwarded to 192.168.0.105 -- but outside the network it just hits the residential IP?
I understand that things here are "working as intended" in the sense that my DNS server is correctly resolving the hostname to the specified IP -- so if I was trying all this on my local network it would be completely functional. The problem, I feel, is masking the internal IP by having the external machine connect to only my residential IP and then there being some behind the scenes layer which translates the requested hostname to the internal IP.
Based on my reading I have a suspicion NAT may be what I'm looking for, but I really don't have good context.