0

I want to build a service that dynamically creates VMs and assigns each VM a public DNS record which could be a full domain or a subdomain. Assume the VMS all live on a single host. The VMs will have a mix of TCP or UDP exposed services running on them, using various ports. The host has one public ip address.

Can I use NAT to do anything with routing the Domains to the VM's or do I need more public ip addresses for this setup?

How do other virtualized hosting companies do this? do they have more ip blocks?

kevzettler
  • 167
  • 1
  • 3
  • 11

1 Answers1

8

Can I use NAT to do anything with routing the Domains

No, NAT is not aware of DNS.

Do I need more public ip addresses

You need one IP per server IP:Port tuple. If everything is running on different ports then you could conceivable use the same IP for everything. Just a reminder, IP knows nothing about DNS, and DNS knows nothing about service ports (unless the application specifically supports SRV records, which is crazy rare for reasons unbeknownst to me).

How do other virtualized hosting companies do this? do they have more ip blocks?

Either the application is DNS aware (like HTTP, which uses application layer headers; or TLS, which uses SNI which is like a header) or they use separate IPs per destination.

fukawi2
  • 5,327
  • 3
  • 30
  • 51
Chris S
  • 77,337
  • 11
  • 120
  • 212