0

I have a dedicated server which has only one public IP address (eg.10.20.30.40) 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:

network-topo.jpg

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 (192.168.1.10)

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
dexi
  • 3
  • 1
  • Do you mean that all servers should be resolvade on a subdomain on the local network or for the entire world? – Orphans Jan 14 '20 at 14:43

1 Answers1

0

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.

https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/

Matt
  • 181
  • 4