That's not possible, since from the outside world only your router exists,
and it has only one unique IP address.
You may have multiple domains pointing to your router, but any software that
finds out via DNS the meaning of domain.com
and domain2.com
will evaluate
both domains to the same IP address, and then will work directly with that address.
After DNS has done its part, the domain name does not matter any more,
and connections are done using the IP address.
What you are asking is only possible with the HTTP and FTP protocols,
since they also transmit domain names along with the request.
This will require your setting up an internal HTTP server, such as Apache or IIS,
which will forward the requests to other HTTP servers established on each computer.
Without an HTTP server, the only way to differentiate between your domains
is via open ports on your router that will be forwarded to the right computer.
For example,
- point domain.com:5000 to 192.168.1.10:5000
- point domain2.com:5001 to 192.168.1.10:5001
In that situation, one domain name is enough.