How to use port forwarding to connect to docker container using DNS name
<p>I have 2 redis containers running on same machine m1.</p>

<p>container1 has port mapping 6379 to 6400 </p>

<pre><code>docker run -d -p 6379:6400 myredisimage1
</code></pre>

<p>container2 has port mapping 6379 to 7500</p>

<pre><code>docker run -d -p 6379:7500 myredisimage2
</code></pre>

<p>I am looking for a solution where other machine m2 can communicate to machine m1, using different DNS names but same port number.</p>

<pre><code>redis.container1.com:6379
redis.container2.com:6379
</code></pre>

<p>and I would like to redirect that request to proper containers inside machine m1.</p>

<p>Is this possible to achieve this ?
</p>