Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.