I have a dedicated server which has only one public IP address (eg. and a domain dedicated to it (example.com)

on that server I have lots of virtual machines hosted on an ESXi Hypervisor, and each vm does a different job (mail server, chat server, file server, etc). each vm took a local IP from my DNS-vm DHCP.

How can I resolve each vm local to a subdomain?

I think putting a vm acting as a DNS server in front could resolve ALL requests to a vm, but I don't know how. please see my server internal network topology:


for example if someone sends request to mail.example.com, his request will reach DNS first and DNS routes all traffic (forward and backward) to specific vm (

  • Do you mean that all servers should be resolvade on a subdomain on the local network or for the entire world?
    – Orphans
    Commented Jan 14, 2020 at 14:43

1 Answer 1


If they weren't all heterogeneous I would suggest a load balancer. But because you're largely running http servers I would use a single NGINX box to reverse proxy back to the service. You can then forward port 25 (or whatever your mail server uses) manually

When using the Nginx web server, server blocks (similar to the virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain off of a single server.



You must log in to answer this question.

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